Implemented ability to delete a series. Refactored some operations to remove unneeded parameters.
This commit is contained in:
parent
83076f02ad
commit
56e8a0059e
9 changed files with 50 additions and 16 deletions
|
|
@ -104,5 +104,13 @@ namespace API.Data
|
|||
.Where(v => seriesIds.Contains(v.SeriesId))
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteSeriesAsync(int seriesId)
|
||||
{
|
||||
var series = await _context.Series.Where(s => s.Id == seriesId).SingleOrDefaultAsync();
|
||||
_context.Series.Remove(series);
|
||||
|
||||
return await _context.SaveChangesAsync() > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue