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()); }
public void UpdateTypeProjet(TypeProjet TypeProjet) { _dbContext.Entry(TypeProjet).State = EntityState.Modified; Save(); }
public void InsertTypeProjet(TypeProjet TypeProjet) { _dbContext.Add(TypeProjet); Save(); }