Пример #1
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         Product = ProductApiModel.FromProduct(await _context.Products.FindAsync(request.Id))
     });
 }
Пример #2
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         Products = await _context.Products.Select(x => ProductApiModel.FromProduct(x)).ToListAsync()
     });
 }