Lots of changes to get code ready to add library.
This commit is contained in:
parent
67b97b3be2
commit
d5eed4e85d
20 changed files with 570 additions and 3 deletions
|
@ -48,12 +48,16 @@ namespace API.Data
|
|||
|
||||
public async Task<IEnumerable<MemberDto>> GetMembersAsync()
|
||||
{
|
||||
return await _context.Users.ProjectTo<MemberDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
return await _context.Users.Include(x => x.Libraries)
|
||||
.Include(x => x.Libraries)
|
||||
.ProjectTo<MemberDto>(_mapper.ConfigurationProvider)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<MemberDto> GetMemberAsync(string username)
|
||||
{
|
||||
return await _context.Users.Where(x => x.UserName == username)
|
||||
.Include(x => x.Libraries)
|
||||
.ProjectTo<MemberDto>(_mapper.ConfigurationProvider)
|
||||
.SingleOrDefaultAsync();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue