public IActionResult Post([FromBody] PublicHouseView publicHouse) { if (ModelState.IsValid) { _service.Create(publicHouse); return(Ok(publicHouse)); } return(BadRequest(ModelState)); }
public ActionResult AddPublicHouse(PublicHouseViewModel publicHouse) { if (publicHouse.Name == null) { throw new ArgumentNullException(nameof(publicHouse)); } publicHouseService.Create(publicHouse); return(Json(publicHouse)); }