|  |  |  | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public virtual List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, int top, string orderByFields) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(whereExpression != null, whereExpression).Take(top).ToList(); | 
|---|
|  |  |  | return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(whereExpression != null, whereExpression).Take(top).IncludesAllFirstLayer().ToList(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public virtual List<TEntity> QueryData(string where, int top, string orderByFields) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(!string.IsNullOrEmpty(where), where).Take(top).ToList(); | 
|---|
|  |  |  | return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(!string.IsNullOrEmpty(where), where).Take(top).IncludesAllFirstLayer().ToList(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | 
|---|
|  |  |  | public virtual List<TEntity> QueryData(string where, int pageIndex, int pageSize, string orderByFields) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields) | 
|---|
|  |  |  | .WhereIF(!string.IsNullOrEmpty(where), where).ToPageList(pageIndex, pageSize); | 
|---|
|  |  |  | .WhereIF(!string.IsNullOrEmpty(where), where).IncludesAllFirstLayer().ToPageList(pageIndex, pageSize); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | 
|---|
|  |  |  | var list = _db.Queryable<TEntity>() | 
|---|
|  |  |  | .OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields) | 
|---|
|  |  |  | .WhereIF(whereExpression != null, whereExpression) | 
|---|
|  |  |  | .IncludesAllFirstLayer() | 
|---|
|  |  |  | .ToPageList(pageIndex, pageSize, ref totalCount); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return new PageGridData<TEntity> { Rows = list, Total = totalCount }; | 
|---|
|  |  |  | 
|---|
|  |  |  | List<TEntity> list = _db.Queryable<TEntity>() | 
|---|
|  |  |  | .OrderBy(orderByModels) | 
|---|
|  |  |  | .WhereIF(whereExpression != null, whereExpression) | 
|---|
|  |  |  | .IncludesAllFirstLayer() | 
|---|
|  |  |  | .ToPageList(pageIndex, pageSize, ref totalCount); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return new PageGridData<TEntity>(totalCount, list); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int totalCount = 0; | 
|---|
|  |  |  | List<TEntity> list = _db.Queryable<TEntity>() | 
|---|
|  |  |  | .WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).ToPageList(pageIndex, pageSize, ref totalCount); | 
|---|
|  |  |  | .WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).IncludesAllFirstLayer().ToPageList(pageIndex, pageSize, ref totalCount); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return new PageGridData<TEntity>(totalCount, list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).OrderBy(orderByModels).ToList(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Task<bool> UpdateDataNavAsync(TEntity Entity) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return _db.UpdateNav(Entity).IncludesAllFirstLayer().ExecuteCommandAsync(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public bool UpdateDataNav(TEntity Entity) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return _db.UpdateNav(Entity).IncludesAllFirstLayer().ExecuteCommand(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //List<TResult> QueryMuch<T, T2, T3, TResult>( | 
|---|
|  |  |  | //    Expression<Func<T, T2, T3, object[]>> joinExpression, | 
|---|
|  |  |  | //    Expression<Func<T, T2, T3, TResult>> selectExpression, | 
|---|