コード例 #1
0
 public async Task <GetTeamByIdResponse> Handle(GetTeamByIdRequest request)
 {
     return(new GetTeamByIdResponse()
     {
         Team = TeamApiModel.FromTeam(await _context.Teams.SingleAsync(x => x.Id == request.Id && x.TenantId == request.TenantId))
     });
 }
コード例 #2
0
            public async Task <GetTeamsResponse> Handle(GetTeamsRequest request)
            {
                var teams = await _context.Teams
                            .Where(x => x.TenantId == request.TenantId)
                            .ToListAsync();

                return(new GetTeamsResponse()
                {
                    Teams = teams.Select(x => TeamApiModel.FromTeam(x)).ToList()
                });
            }