public async Task <Customer> GetAsync(ICustomerIdentity customer) { if (customer == null) { throw new ArgumentNullException(nameof(customer)); } return(mapper.Map <Customer>(await Get(customer))); }
private async Task <Entities.Customer> Get(ICustomerIdentity customer) { if (customer == null) { throw new ArgumentNullException(nameof(customer)); } return(await context.Customers.Include(x => x.Orders) .FirstOrDefaultAsync(x => x.Id == customer.Id)); }
public async Task <IEnumerable <Order> > GetByCustomerAsync(ICustomerIdentity customer) { return(mapper.Map <IEnumerable <Order> >(await context.Orders.Where(x => x.CustomerId == customer.Id).Include(x => x.Book) .Include(x => x.Customer).ToListAsync())); }
public Task <IEnumerable <Order> > GetByCustomerAsync(ICustomerIdentity customer) { return(OrderDataAccess.GetByCustomerAsync(customer)); }
public Task <Customer> GetAsync(ICustomerIdentity customer) { return(CustomerDataAccess.GetAsync(customer)); }