public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Product = ProductApiModel.FromProduct(await _context.Products
                                               .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 products = await _context.Products
                               .Include(x => x.Tenant)
                               .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                               .ToListAsync();

                return(new Response()
                {
                    Products = products.Select(x => ProductApiModel.FromProduct(x)).ToList()
                });
            }