public async Task <IHttpActionResult> PostOrder(OrderResource resoure) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } OrderResource result = await _ordersService.AddAsync(resoure); return(CreatedAtRoute("DefaultApi", new { id = result.Id }, result)); }
public async Task <IActionResult> Post([FromBody] Order order) { order = await _ordersService.AddAsync(order); return(CreatedAtAction(nameof(Get), new { id = order.Id }, order)); }