public string GetCommand(string field, uint where, object value) { var builder = new SQLUpdate(); builder.Table = "creature_template"; builder.AddValue(field, value); builder.AddWhere("entry", where); return(builder.Build()); }
public void TestSQLUpdate() { var values = new Dictionary <Row <TestDataOnePK>, RowList <TestDataOnePK> > { { _valuesOnePk.ElementAt(0), _conditionsOnePk }, { _valuesOnePk.ElementAt(1), _conditionsOnePk } }; var update = new SQLUpdate <TestDataOnePK>(values); Assert.AreEqual("UPDATE `test_data_one_p_k` SET `ID`=4, `TestInt1`=5, `TestString1`='string2', `NoQuotes`=@CGUID WHERE `ID` IN (1, 2);" + Environment.NewLine + "UPDATE `test_data_one_p_k` SET `ID`=6, `TestInt1`=7, `NoQuotes`=@CGUID+1 WHERE `ID` IN (1, 2);" + Environment.NewLine, update.Build()); }
public void TestSQLUpdate() { var values = new Dictionary<Row<TestDataOnePK>, RowList<TestDataOnePK>> { {_valuesOnePk.ElementAt(0), _conditionsOnePk}, {_valuesOnePk.ElementAt(1), _conditionsOnePk} }; var update = new SQLUpdate<TestDataOnePK>(values); Assert.AreEqual("UPDATE `test_data_one_p_k` SET `ID`=4, `TestInt1`=5, `TestString1`='string2' WHERE `ID` IN (1, 2);" + Environment.NewLine + "UPDATE `test_data_one_p_k` SET `ID`=6, `TestInt1`=7 WHERE `ID` IN (1, 2);" + Environment.NewLine, update.Build()); }