public News Add(News item) { if (string.IsNullOrEmpty(item.text)) { throw new ArgumentNullException(); } return new News(); }
public ActionResult Put(News item) { try { var newItem = this._rpdbService.Add(item); return new JsonResult { Data = newItem }; } catch (ArgumentNullException) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } }