public IActionResult Post([FromBody] TypeProjet typeprojet)
 {
     using (var scope = new TransactionScope())
     {
         _typeprojetRepository.InsertTypeProjet(typeprojet);
         scope.Complete();
         return(CreatedAtAction(nameof(Get), new { id = typeprojet.Id }, typeprojet));
     }
 }
 public IActionResult Put([FromBody] TypeProjet Model)
 {
     if (Model != null)
     {
         using (var scope = new TransactionScope())
         {
             _typeprojetRepository.UpdateTypeProjet(Model);
             scope.Complete();
             return(new OkResult());
         }
     }
     return(new NoContentResult());
 }
Exemple #3
0
 public void UpdateTypeProjet(TypeProjet TypeProjet)
 {
     _dbContext.Entry(TypeProjet).State = EntityState.Modified;
     Save();
 }
Exemple #4
0
 public void InsertTypeProjet(TypeProjet TypeProjet)
 {
     _dbContext.Add(TypeProjet);
     Save();
 }