public async Task <GetBrandByIdResponse> Handle(GetBrandByIdRequest request) { return(new GetBrandByIdResponse() { Brand = BrandApiModel.FromBrand(await _context.Brands.FindAsync(request.Id)) }); }
public async Task <Response> Handle(Request request) { var brands = await _context.Brands .ToListAsync(); return(new Response() { Brands = brands.Select(x => BrandApiModel.FromBrand(x)).ToList() }); }