public void DeleteDownloadByFileName(string fileName) { var download = _context.Downloads.Where(x => x.DownloadedFileName == fileName).Include(b => b.Details).First(); _context.Remove(download); _context.SaveChanges(); }
public void DeleteDetailsByDownloadId(int downloadId) { var detail = _context.Details.Where(x => x.DownloadId == downloadId); _context.Remove(detail); _context.SaveChanges(); }