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)); }
public Task <List <Customer> > Handle(GetAllCustomersV1Query request, CancellationToken cancellationToken) { return(_dbContext.Customers .Include(i => i.Orders) .ToListAsync()); }