示例#1
0
        public async Task <IActionResult> New(CustomerSpecification spec)
        {
            await this._customers.AddAsync(spec.Name);

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

            return(this.Ok(CustomerRepresentation.FromEntity(customer)));
        }
 public IActionResult New(CustomerSpecification spec)
 {
     this._customers.Add(spec.Name);
     return(this.RedirectToAction("List"));
 }