public void SavePrediction(PredictionDto prediction) { using IDbConnection db = new MySqlConnection("Server=127.0.0.1;Database=simplewebapp;Uid=root;Pwd=my-secret-pw;"); string sqlQuery = "INSERT INTO predictions (PredictionString) VALUES (@PredictionString)"; int rowsAffected = db.Execute(sqlQuery, prediction); }
public void UpdatePredictionById(PredictionDto prediction) { using IDbConnection db = new MySqlConnection("Server=127.0.0.1;Database=simplewebapp;Uid=root;Pwd=my-secret-pw;"); string sqlQuery = $"UPDATE predictions SET PredictionString = @PredictionString WHERE Id = @Id"; int rowsAffected = db.Execute(sqlQuery, prediction); }
public void UpdatePrediction(PredictionDto prediction) { using (IDbConnection db = new MySqlConnection("Server=127.0.0.1;Database=myDataBase;Uid=root;Pwd=my-secret-pw;")) { db.Query <PredictionDto>("UPDATE predictions SET PredictionText = @predictionText WHERE id = @id", prediction); } }
public void SavePrediction(PredictionDto prediction) { using (IDbConnection db = new MySqlConnection("Server=127.0.0.1;Database=myDataBase;Uid=root;Pwd=my-secret-pw;")) { string sqlQuery = "INSERT INTO predictions (PredictionText) Values(@PredictionText)"; int rowsAffected = db.Execute(sqlQuery, prediction); } }
public void DeletePrediction(PredictionDto prediction) { using (IDbConnection db = new MySqlConnection(CONNECTIONSTRING)) { string sqlQuery = "DELETE FROM predictions WHERE id=@Id"; int rowsAffected = db.Execute(sqlQuery, prediction); } }
public void UpdatePrediction(PredictionDto prediction) { using (IDbConnection db = new MySqlConnection(CONNECTIONSTRING)) { string sqlQuery = "UPDATE predictions SET predictionText=@PredictionText WHERE id=@Id"; int rowsAffected = db.Execute(sqlQuery, prediction); } }
public void UpdatePrediction(PredictionDto prediction) { throw new NotImplementedException(); }
public void UpdatePrediction(PredictionDto prediction) { _predictions.Remove(prediction); _predictions.Add(prediction); }
public void InsertPrediction(PredictionDto prediction) { _predictions.Add(prediction); }
public void DeletePrediction(PredictionDto prediction) { _predictions.Remove(prediction); }