public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         BodyPart = BodyPartApiModel.FromBodyPart(await _context.BodyParts
                                                  .Include(x => x.Tenant)
                                                  .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId))
     });
 }
Пример #2
0
            public async Task <Response> Handle(Request request)
            {
                var bodyParts = await _context.BodyParts
                                .Include(x => x.Tenant)
                                .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                                .ToListAsync();

                return(new Response()
                {
                    BodyParts = bodyParts.Select(x => BodyPartApiModel.FromBodyPart(x)).ToList()
                });
            }