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

            return(this.RedirectToAction("List"));
        }
コード例 #2
0
ファイル: ApiController.cs プロジェクト: JokeClaeys/bookstore
        public async Task <ActionResult <CustomerRepresentation> > CreateCustomer([FromBody] CustomerSpecification spec)
        {
            var customer = await this._customers.AddAsync(spec.Name);

            return(this.Ok(CustomerRepresentation.FromEntity(customer)));
        }
コード例 #3
0
 public IActionResult New(CustomerSpecification spec)
 {
     this._customers.Add(spec.Name);
     return(this.RedirectToAction("List"));
 }