public async Task <ActionResult <CustomerRepresentation> > CreateCustomer([FromBody] CustomerSpecification spec) { var customer = await this._customers.AddAsync(spec.Name); return(this.Ok(CustomerRepresentation.FromEntity(customer))); }
public async Task <ActionResult <IEnumerable <CustomerRepresentation> > > FindCustomers() { var customers = await this._customers.QueryAsync(c => true); return(this.Ok(customers.Select(d => CustomerRepresentation.FromEntity(d)))); }