Beispiel #1
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         Customer = CustomerApiModel.FromCustomer(await _context.Customers.FindAsync(request.Id))
     });
 }
Beispiel #2
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         Customers = await _context.Customers.Select(x => CustomerApiModel.FromCustomer(x)).ToListAsync()
     });
 }
        public static CustomerApiModel FromCustomer(Customer customer)
        {
            var model = new CustomerApiModel();

            model.CustomerId = customer.CustomerId;
            model.Firstname  = customer.Firstname;
            return(model);
        }