Beispiel #1
0
 public IActionResult Create([FromBody] TypePlan type)
 {
     if (ModelState.IsValid)
     {
         var result     = typeRepository.Create(type);
         var lastResult = result ? typeRepository.GetLastInserted() : null;
         var uri        = Url.Action("Get", new { id = lastResult.Id });
         return(Created(uri, lastResult));
     }
     return(BadRequest());
 }