public IActionResult GetById(/*[FromRoute]*/ int Id) { TypeTheme type = new TypeTheme(); type = _typeRepo.GetById(Id); return(Ok(type)); }
public IActionResult Update([FromBody] TypeTheme typeTheme) { int success = _typeRepo.Update(typeTheme); if (success == 0) { return(Ok()); } else { return(NotFound()); } }
//CREATE public int Create(TypeTheme typetheme) { Command cmd = new Command("Create_TypeTheme", true); cmd.AddParameter("nom", typetheme.Nom); int Success = 0; try { _connection.ExecuteNonQuery(cmd); } catch (SqlException ex) { if (ex.Message.Contains("")) { return(Success = 1); } } return(Success); }