Lots of changes to get code ready to add library.

This commit is contained in:
Joseph Milazzo 2020-12-17 11:27:19 -06:00
parent 67b97b3be2
commit d5eed4e85d
20 changed files with 570 additions and 3 deletions

View file

@ -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();
}