Implemented the ability to delete a Library.
This commit is contained in:
parent
7b1714349d
commit
5e18c1bf3a
3 changed files with 16 additions and 0 deletions
|
@ -53,6 +53,13 @@ namespace API.Data
|
|||
.SingleAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteLibrary(int libraryId)
|
||||
{
|
||||
var library = await GetLibraryForIdAsync(libraryId);
|
||||
_context.Library.Remove(library);
|
||||
return await _context.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<LibraryDto>> GetLibrariesAsync()
|
||||
{
|
||||
return await _context.Library
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue