public IActionResult Post([FromBody] Dish dish) { if(!ModelState.IsValid) { return BadRequest(ModelState); } var result = _repository.CreateDish(dish); return CreatedAtAction("Get", new { id = dish.Id }, result); }
public IActionResult Post(Dish dish) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var res = _repository.CreateDish(dish); return(CreatedAtAction("get", new { dish.Id }, res)); }