示例#1
0
        public async Task <ActionResult <CustomerRepresentation> > CreateCustomer([FromBody] CustomerSpecification spec)
        {
            var customer = await this._customers.AddAsync(spec.Name);

            return(this.Ok(CustomerRepresentation.FromEntity(customer)));
        }
示例#2
0
        public async Task <ActionResult <IEnumerable <CustomerRepresentation> > > FindCustomers()
        {
            var customers = await this._customers.QueryAsync(c => true);

            return(this.Ok(customers.Select(d => CustomerRepresentation.FromEntity(d))));
        }