Implements search functionality and prepares for upcoming paging in v0.3.
This commit is contained in:
parent
852317d3a6
commit
2887fab53f
17 changed files with 174 additions and 15 deletions
|
|
@ -60,6 +60,15 @@ namespace API.Data
|
|||
return await _context.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Library>> GetLibrariesForUserIdAsync(int userId)
|
||||
{
|
||||
return await _context.Library
|
||||
.Include(l => l.AppUsers)
|
||||
.Where(l => l.AppUsers.Select(ap => ap.Id).Contains(userId))
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<LibraryDto>> GetLibraryDtosAsync()
|
||||
{
|
||||
return await _context.Library
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue