Beispiel #1
0
 public ActionResult <string> GetByID(int id)
 {
     if (id != 0)
     {
         var category = _repository.GetByID(id);
         if (category != null)
         {
             return(Ok(JsonConvert.SerializeObject(category, Formatting.Indented)));
         }
         return(NotFound());
     }
     else
     {
         return(NotFound());
     }
 }