public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Category = CategoryApiModel.FromCategory(await _context.Categories
                                                  .Include(x => x.Tenant)
                                                  .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId))
     });
 }
Exemplo n.º 2
0
            public async Task <Response> Handle(Request request)
            {
                var categorys = await _context.Categories
                                .Include(x => x.Tenant)
                                .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                                .ToListAsync();

                return(new Response()
                {
                    Categories = categorys.Select(x => CategoryApiModel.FromCategory(x)).ToList()
                });
            }