protected override void ToSqlWhen(StringBuilder sb, ColumnInfo[] primarys, object d) { if (_table.Primarys.Length == 1) { sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys.First().GetMapValue(d))); return; } var pkidx = 0; foreach (var pk in _table.Primarys) { if (pkidx > 0) { sb.Append(", "); } sb.Append(MsAccessUtils.GetCastSql(_commonUtils.FormatSql("{0}", pk.GetMapValue(d)), typeof(string))); ++pkidx; } }
protected override void ToSqlCase(StringBuilder caseWhen, ColumnInfo[] primarys) { if (_table.Primarys.Length == 1) { caseWhen.Append(_commonUtils.QuoteReadColumn(_table.Primarys.First().Attribute.MapType, _commonUtils.QuoteSqlName(_table.Primarys.First().Attribute.Name))); return; } caseWhen.Append("("); var pkidx = 0; foreach (var pk in _table.Primarys) { if (pkidx > 0) { caseWhen.Append(", "); } caseWhen.Append(MsAccessUtils.GetCastSql(_commonUtils.QuoteReadColumn(_table.Primarys.First().Attribute.MapType, _commonUtils.QuoteSqlName(pk.Attribute.Name)), typeof(string))); ++pkidx; } caseWhen.Append(")"); }