Exemple #1
0
 public async Task <GetTeamMemberByIdResponse> Handle(GetTeamMemberByIdRequest request)
 {
     return(new GetTeamMemberByIdResponse()
     {
         TeamMember = TeamMemberApiModel.FromTeamMember(await _context.TeamMembers.SingleAsync(x => x.Id == request.Id && x.TenantId == request.TenantId))
     });
 }
            public async Task <GetTeamMembersResponse> Handle(GetTeamMembersRequest request)
            {
                var teamMembers = await _context.TeamMembers
                                  .Where(x => x.TenantId == request.TenantId)
                                  .ToListAsync();

                return(new GetTeamMembersResponse()
                {
                    TeamMembers = teamMembers.Select(x => TeamMemberApiModel.FromTeamMember(x)).ToList()
                });
            }