Esempio n. 1
0
 public Task <List <GetAllCustomersV1QueryResult> > Handle(GetAllCustomersV1Query request, CancellationToken cancellationToken)
 {
     return(_dbContext.Customers
            .Select(i => new GetAllCustomersV1QueryResult
     {
         FirstName = i.FirstName,
         LastName = i.LastName,
         FullName = i.FullName,
         ID = i.ID
     })
            .ToListAsync(cancellationToken));
 }
Esempio n. 2
0
 public Task <List <Customer> > Handle(GetAllCustomersV1Query request, CancellationToken cancellationToken)
 {
     return(_dbContext.Customers
            .Include(i => i.Orders)
            .ToListAsync());
 }