Exemplo n.º 1
0
 public async Task <GetBrandByIdResponse> Handle(GetBrandByIdRequest request)
 {
     return(new GetBrandByIdResponse()
     {
         Brand = BrandApiModel.FromBrand(await _context.Brands.FindAsync(request.Id))
     });
 }
Exemplo n.º 2
0
            public async Task <Response> Handle(Request request)
            {
                var brands = await _context.Brands
                             .ToListAsync();

                return(new Response()
                {
                    Brands = brands.Select(x => BrandApiModel.FromBrand(x)).ToList()
                });
            }