Exemple #1
0
 public IActionResult Insert([FromBody] Period period)
 {
     if (ModelState.IsValid)
     {
         var result     = _repoPeriod.Insert(period);
         var lastResult = _repoPeriod.GetLastInserted();
         var uri        = Url.Action("Get", new { Id = lastResult.Id, Version = "1.0" });
         return(Created(uri, lastResult));
     }
     return(BadRequest());
 }