public IActionResult Create([FromBody] Sous_cat sous) { try { _souService.Creation(sous); return(Ok()); } catch (AppException ex) { // return error message if there was an exception return(BadRequest(new { message = ex.Message })); } }
public Sous_cat Creation(Sous_cat soucat) { db.Sous_Cats.Add(soucat); db.SaveChanges(); return(soucat); }