private void QueryByField(string fieldName, string op, object fieldValue) { var paramId = NextParamId(); var newCondition = string.Format("{0} {1} {2}", adapter.Field(fieldName), op, adapter.Parameter(paramId)); AddParameter(paramId, fieldValue); conditions.Add(newCondition); }
public void SelectAll() { var entityDef = _entityType.GetEntityDefines(); var tablename = entityDef.Item1.Name; if (string.IsNullOrEmpty(tablename)) { tablename = entityDef.Item1.TableAttribute.Name; } //var schema = entityDef.Item1.TableAttribute?.Schema; var tbname = _adapter.Table(tablename, _schema); if (_isSubQuery && !string.IsNullOrEmpty(JoinSubAliasTableName)) { tbname = JoinSubAliasTableName; } foreach (var cdef in entityDef.Item2) { var s = _adapter.Field(tbname, cdef.AliasName); if (!string.IsNullOrEmpty(cdef.AliasName)) { //s += " as " + _adapter.Field(cdef.Name); } else { s = _adapter.Field(tbname, cdef.Name); } _selectionList.Add(s); } }
private string GetCondition(string tableName, string fieldName, string op, object fieldValue) { string paramId = this.GetParamId(fieldName); string key = _adapter.Field(tableName, fieldName); string value = _adapter.Parameter(paramId); this.AddParameter(value, fieldValue); return(string.Format("{0} {1} {2}", key, op, value)); }
public void SelectAll() { var entityDef = _entityType.GetEntityDefines(); foreach (var cdef in entityDef.Item2) { var s = _adapter.Field(cdef.AliasName); if (!string.IsNullOrEmpty(cdef.AliasName)) { //s += " as " + _adapter.Field(cdef.Name); } else { s = _adapter.Field(cdef.Name); } _selectionList.Add(s); } }