Exemple #1
0
 public async Task <GetContributorByIdResponse> Handle(GetContributorByIdRequest request)
 {
     return(new GetContributorByIdResponse()
     {
         Contributor = ContributorApiModel.FromContributor(await _context.Contributors
                                                           .Include(x => x.Tenant)
                                                           .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId))
     });
 }
Exemple #2
0
            public async Task <GetContributorsResponse> Handle(GetContributorsRequest request)
            {
                var contributors = await _context.Contributors
                                   .Include(x => x.Tenant)
                                   .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                                   .ToListAsync();

                return(new GetContributorsResponse()
                {
                    Contributors = contributors.Select(x => ContributorApiModel.FromContributor(x)).ToList()
                });
            }