Beispiel #1
0
        public JsonResult AddAdvert([FromBody] AdvertModel advertModel)
        {
            string response = string.Empty;

            if (ModelState.IsValid)
            {
                response = _dataProcessor.AddAdvert(advertModel.Number, advertModel.CreatedDate, advertModel.Text, advertModel.UserId, advertModel.Rating);
            }
            else
            {
                response = "model is invalid";
            }
            return(Json(response));
        }