예제 #1
0
        public IActionResult Post([FromBody] PublicHouseView publicHouse)
        {
            if (ModelState.IsValid)
            {
                _service.Create(publicHouse);

                return(Ok(publicHouse));
            }
            return(BadRequest(ModelState));
        }
예제 #2
0
        public ActionResult AddPublicHouse(PublicHouseViewModel publicHouse)
        {
            if (publicHouse.Name == null)
            {
                throw new ArgumentNullException(nameof(publicHouse));
            }

            publicHouseService.Create(publicHouse);

            return(Json(publicHouse));
        }