Example #1
0
 public IActionResult CreteFruit([FromBody] Fruit fruit)
 {
     try
     {
         _fruitService.SaveFruit(fruit);
         return(Created(Request.GetDisplayUrl(), fruit.Id.ToString()));
     }
     catch (Exception)
     {
         return(StatusCode(500)); throw;
     }
 }