Beispiel #1
0
 public IActionResult Post([FromBody] Models.Autorisation Model)
 {
     using (var scope = new TransactionScope())
     {
         _autorisationRepository.InsertAutorisation(Model);
         scope.Complete();
         return(CreatedAtAction(nameof(Get), new { id = Model.Id }, Model));
     }
 }
Beispiel #2
0
 public IActionResult Put([FromBody] Models.Autorisation Model)
 {
     if (Model != null)
     {
         using (var scope = new TransactionScope())
         {
             _autorisationRepository.UpdateAutorisation(Model);
             scope.Complete();
             return(new OkResult());
         }
     }
     return(new NoContentResult());
 }