Ejemplo n.º 1
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         Product = ProductApiModel.FromProduct(await _context.Products.FindAsync(request.Id))
     });
 }
Ejemplo n.º 2
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         Products = await _context.Products.Select(x => ProductApiModel.FromProduct(x)).ToListAsync()
     });
 }