/// <summary> /// 查询实体 /// </summary> /// <param name="ConditionForSelect">自定义条件</param> /// <param name="FieldNames">自定义字段</param> /// <returns>实体集合</returns> public EntitySet <T> Query(string ConditionForSelect, params string[] FieldNames) { EntityStruct es = EntityStructManager.GetEntityStruct(typeof(T)); DataSet ds = this.GetDSQuery(es.TableName, ConditionForSelect, FieldNames); if (ds != null) { EntitySet <T> result = FillSetForDS(ds, es); result.RecordCount = result.Count; return(result); } return(new EntitySet <T>()); }
/// <summary> /// 查询实体 /// </summary> /// <param name="ConditionForSelect">自定义条件</param> /// <param name="PageIndex">页索引号</param> /// <param name="PageSize">页行数</param> /// <param name="FieldNames">自定义字段</param> /// <returns>实体集合</returns> public EntitySet <T> Query(SQLCondition ConditionForSelect, int PageIndex, int PageSize, params string[] FieldNames) { EntityStruct es = EntityStructManager.GetEntityStruct(typeof(T)); int RecordCount = 0; DataSet ds = this.GetDSQuery(es.TableName, ConditionForSelect, PageIndex, PageSize, ref RecordCount, FieldNames); if (ds != null) { EntitySet <T> result = FillSetForDS(ds, es); result.RecordCount = RecordCount; return(result); } return(new EntitySet <T>()); }
/// <summary> /// 构造函数 /// </summary> public ORMQuery() { this._DataBaseName = EntityStructManager.GetEntityStruct(typeof(T)).DatabaseName; }