Beispiel #1
0
        public News Add(News item)
        {
            if (string.IsNullOrEmpty(item.text))
            {
                throw new ArgumentNullException();
            }

            return new News();
        }
Beispiel #2
0
 public ActionResult Put(News item)
 {
     try
     {
         var newItem = this._rpdbService.Add(item);
         return new JsonResult
             {
                 Data = newItem
             };
     }
     catch (ArgumentNullException)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
 }