public void ValuesSimple1() { SetList w = new SetList(global::SqlBuilder.Format.MsSQL); w.Append("a", "b", "c"); string result = w.GetSql(); string sql = "[a]=@a, [b]=@b, [c]=@c"; Assert.AreEqual(sql, result); }
protected void ParseSet <R>(Expression <Func <T, R> > property, Expression <Func <T, R> > value) { InitializeSetList(); Parse(SetList, property.Body); SetList.Append(" = "); Parse(SetList, value.Body); }
protected void AppendUpdateColumnValue(MemberInfo column, object value) { InitializeSetList(); AppendColumn(SetList, column); SetList.Append(" = "); AppendParameter(SetList, value); }
private void InitializeSetList() { if (SetList == null) { SetList = new StringBuilder(); } else { SetList.Append(", "); } }
public void ValuesSimple1() { SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql; SetList w = new SetList(SqlBuilder.DefaultFormatter); w.Append("a", "b", "c"); string result = w.GetSql(); string sql = "[a]=@a, [b]=@b, [c]=@c"; Assert.AreEqual(sql, result); }
public void ValuesSimple1() { NKnife.Storages.SQL.Common.SuperSql.DefaultFormatter = FormatterLibrary.MsSql; SetList w = new SetList(NKnife.Storages.SQL.Common.SuperSql.DefaultFormatter); w.Append("a", "b", "c"); string result = w.GetSql(); string sql = "[a]=@a, [b]=@b, [c]=@c"; Assert.Equal(sql, result); }