public new MonthPlanList GetByIdList(object[] idList, EagerLoadOptions eagerLoad = null) { return base.GetByIdList(idList, eagerLoad) as MonthPlanList; }
public new Chapter GetById(object id, EagerLoadOptions eagerLoad = null) { return base.GetById(id, eagerLoad) as Chapter; }
public new ChapterList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null) { return base.GetByTreePId(treePId, eagerLoad) as ChapterList; }
public new OperationACList GetAll(PagingInfo paging= null, EagerLoadOptions eagerLoad = null) { return base.GetAll(paging, eagerLoad) as OperationACList; }
public new OperationACList GetByTreeParentIndex(string treeIndex, EagerLoadOptions eagerLoad = null) { return base.GetByTreeParentIndex(treeIndex, eagerLoad) as OperationACList; }
public new ProductAttachement GetById(object id, EagerLoadOptions eagerLoad = null) { return base.GetById(id, eagerLoad) as ProductAttachement; }
public new ProductAttachementList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null) { return base.GetByTreePId(treePId, eagerLoad) as ProductAttachementList; }
/// <summary> /// 通过 IQuery 对象来查询实体。 /// </summary> /// <param name="query">查询对象。</param> /// <param name="paging">分页信息。</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <param name="markTreeFullLoaded">如果某次查询结果是一棵完整的子树,那么必须设置此参数为 true ,才可以把整个树标记为完整加载。</param> /// <returns></returns> protected EntityList QueryList(IQuery query, PagingInfo paging = null, EagerLoadOptions eagerLoad = null, bool markTreeFullLoaded = false) { return(this.DataQueryer.QueryList(query, paging, eagerLoad, markTreeFullLoaded)); }
/// <summary> /// 子类重写此方法来实现通过父 Id 列表来获取所有组合子对象的列表 /// </summary> /// <param name="parentIdList">The parent identifier list.</param> /// <param name="paging">分页信息。</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public virtual EntityList GetByParentIdList(object[] parentIdList, PagingInfo paging, EagerLoadOptions eagerLoad) { var parentProperty = _repository.FindParentPropertyInfo(true); var mp = (parentProperty.ManagedProperty as IRefEntityProperty).RefIdProperty; var table = qf.Table(_repository); var q = qf.Query( table, where : qf.Constraint(table.Column(mp), PropertyOperator.In, parentIdList) ); var list = this.QueryList(q, paging, eagerLoad, true); return(list); }
/// <summary> /// 子类重写此方法来实现通过父 Id 列表来获取所有组合子对象的列表 /// </summary> /// <param name="parentIdList">The parent identifier list.</param> /// <param name="paging">分页信息。</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public virtual EntityList GetByParentIdList(object[] parentIdList, PagingInfo paging, EagerLoadOptions eagerLoad) { var parentProperty = _repository.FindParentPropertyInfo(true); var mp = (parentProperty.ManagedProperty as IRefEntityProperty).RefIdProperty; var table = f.Table(_repository); var parentColumn = table.Column(mp); var q = f.Query( table, where : f.Constraint(parentColumn, PropertyOperator.In, parentIdList), orderBy: new List <IOrderBy> { f.OrderBy(parentColumn) } //orderBy: _repository.SupportTree ? null : new List<IOrderBy> { f.OrderBy(parentColumn) } ); var list = this.QueryList(q, paging, eagerLoad, true); return(list); }
/// <summary> /// 通过 linq 来查询实体。 /// </summary> /// <param name="queryable">linq 查询对象。</param> /// <param name="paging">分页信息。</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> /// <exception cref="System.InvalidProgramException"></exception> protected EntityList QueryList(IQueryable queryable, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { return(this.DataQueryer.QueryList(queryable, paging, eagerLoad)); }
EntityList IRepositoryDataQueryAPI.QueryList(FormattedSql sql, PagingInfo paging, EagerLoadOptions eagerLoad) { return(this.QueryList(sql, paging, eagerLoad)); }
EntityList IRepositoryDataQueryAPI.QueryList(IQuery query, PagingInfo paging, EagerLoadOptions eagerLoad, bool markTreeFullLoaded) { return(this.QueryList(query, paging, eagerLoad, markTreeFullLoaded)); }
EntityList IRepositoryDataQueryAPI.QueryList(IQueryable queryable, PagingInfo paging, EagerLoadOptions eagerLoad) { return(this.QueryList(queryable, paging, eagerLoad)); }
public new MonthPlanList GetByTreeParentIndex(string treeIndex, EagerLoadOptions eagerLoad = null) { return base.GetByTreeParentIndex(treeIndex, eagerLoad) as MonthPlanList; }
/// <summary> /// <see cref="ODataQueryCriteria"/> 查询的数据层实现。 /// </summary> /// <param name="criteria"></param> public virtual EntityList GetBy(ODataQueryCriteria criteria) { var f = QueryFactory.Instance; var t = f.Table(this.Repository, "T0"); var q = f.Query(from: t); var properties = this.Repository.EntityMeta.ManagedProperties.GetCompiledProperties(); #region Filter if (!string.IsNullOrWhiteSpace(criteria.Filter)) { var parser = new ODataFilterParser { _properties = properties }; parser.Parse(criteria.Filter, q); } #endregion #region OrderBy if (!string.IsNullOrWhiteSpace(criteria.OrderBy)) { var orderByProperties = criteria.OrderBy.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (var orderByExp in orderByProperties) { var values = orderByExp.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); var property = values[0]; var orderBy = properties.Find(property, true); if (orderBy != null) { var dir = values.Length == 1 || values[1].ToLower() == "asc" ? OrderDirection.Ascending : OrderDirection.Descending; q.OrderBy.Add(f.OrderBy(t.Column(orderBy), dir)); } } } #endregion #region Expand if (!string.IsNullOrWhiteSpace(criteria.Expand)) { var eagerLoad = new EagerLoadOptions(); var expandProperties = criteria.Expand.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); var splitter = new char[] { '.' }; foreach (var expand in expandProperties) { //如果有'.',表示类似于 Section.Chapter.Book 这种表达式。 if (expand.Contains('.')) { Type nextEntityType = null;//下一个需要使用的实体类型 var cascadeProperties = expand.Split(splitter, StringSplitOptions.RemoveEmptyEntries); foreach (var property in cascadeProperties) { var container = properties; if (nextEntityType != null) { var meta = CommonModel.Entities.Find(nextEntityType); container = meta.ManagedProperties.GetCompiledProperties(); } var mp = container.Find(property, true); if (mp != null) { var refProperty = mp as IRefEntityProperty; if (refProperty != null) { eagerLoad.LoadWith(refProperty); nextEntityType = refProperty.RefEntityType; } else if (mp is IListProperty) { eagerLoad.LoadWith(mp as IListProperty); nextEntityType = (mp as IListProperty).ListEntityType; } } } } else { var mp = properties.Find(expand, true); if (mp != null) { if (mp is IListProperty) { eagerLoad.LoadWith(mp as IListProperty); } else if (mp is IRefEntityProperty) { eagerLoad.LoadWith(mp as IRefEntityProperty); } } else if (expand == EntityConvention.TreeChildrenPropertyName) { eagerLoad.LoadWithTreeChildren(); } } criteria.EagerLoad = eagerLoad; } } #endregion return(this.QueryList(q, criteria.PagingInfo, criteria.EagerLoad)); }
public new MonthPlan GetFirst(EagerLoadOptions eagerLoad = null) { return base.GetFirst(eagerLoad) as MonthPlan; }
/// <summary> /// 从持久层中查询数据。 /// 本方法只能由仓库中的方法来调用。本方法的返回值的类型将与仓库中方法的返回值保持一致。 /// 支持的返回值:EntityList、Entity、int、LiteDataTable。 /// </summary> /// <param name="queryable"></param> /// <param name="paging"></param> /// <param name="eagerLoad"></param> /// <returns></returns> public object QueryData(IQueryable queryable, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { var query = ConvertToQuery(queryable); return(this.QueryData(query, paging, eagerLoad)); }
public new ProductAttachementList GetByParentIdList(object[] parentIdList, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { return base.GetByParentIdList(parentIdList, paging, eagerLoad) as ProductAttachementList; }
/// <summary> /// 分页查询所有的实体类 /// </summary> /// <param name="paging">分页信息。</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public EntityList GetAll(PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { return(this.DoGetAll(paging, eagerLoad)); }
internal void SetDataLoadOptions(PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { if (!PagingInfo.IsNullOrEmpty(paging)) { this.PagingInfo = paging; } if (eagerLoad != null && eagerLoad.CoreList.Count > 0) { if (this.EagerLoadOptions != null) { for (int i = 0, c = eagerLoad.CoreList.Count; i < c; i++) { var item = eagerLoad.CoreList[i]; this.EagerLoad(item); } } else { this.EagerLoadOptions = eagerLoad; } } }
/// <summary> /// 查询第一个实体。 /// </summary> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public Entity GetFirst(EagerLoadOptions eagerLoad = null) { return(this.DoGetFirst(eagerLoad)); }
public new OperationACList GetByIdList(object[] idList, EagerLoadOptions eagerLoad = null) { return base.GetByIdList(idList, eagerLoad) as OperationACList; }
/// <summary> /// 通过Id在数据层中查询指定的对象 /// </summary> /// <param name="id">The unique identifier.</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public Entity GetById(object id, EagerLoadOptions eagerLoad = null) { return(this.DoGetById(id, eagerLoad)); }
public new OperationAC GetFirst(EagerLoadOptions eagerLoad = null) { return base.GetFirst(eagerLoad) as OperationAC; }
/// <summary> /// 获取指定 id 集合的实体列表。 /// </summary> /// <param name="idList"></param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public EntityList GetByIdList(object[] idList, EagerLoadOptions eagerLoad = null) { return(this.DoGetByIdList(idList, eagerLoad)); }
public new ChapterList GetByParentIdList(object[] parentIdList, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { return base.GetByParentIdList(parentIdList, paging, eagerLoad) as ChapterList; }
/// <summary> /// 通过父对象 Id 分页查询子对象的集合。 /// </summary> /// <param name="parentId"></param> /// <param name="paging">分页信息。</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public EntityList GetByParentId(object parentId, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { return(this.DoGetByParentId(parentId, paging, eagerLoad)); }
/// <summary> /// 通过 linq 来查询实体。 /// </summary> /// <param name="queryable">linq 查询对象。</param> /// <param name="paging">分页信息。</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> /// <exception cref="System.InvalidProgramException"></exception> protected EntityList QueryList(IQueryable queryable, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { var query = ConvertToQuery(queryable); return(this.QueryList(query, paging, eagerLoad)); }
/// <summary> /// 获取指定索引对应的树节点的所有父节点。 /// 查询出的父节点同样以一个部分树的形式返回。 /// </summary> /// <param name="treeIndex"></param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public EntityList GetAllTreeParents(string treeIndex, EagerLoadOptions eagerLoad = null) { return(this.DoGetAllTreeParents(treeIndex, eagerLoad)); }
public new MonthPlanList GetByParentId(object parentId, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { return base.GetByParentId(parentId, paging, eagerLoad) as MonthPlanList; }
/// <summary> /// 查找指定树节点的直接子节点。 /// </summary> /// <param name="treePId">需要查找的树节点的Id.</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public EntityList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null) { return(this.DoGetByTreePId(treePId, eagerLoad)); }
public new MonthPlanList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null) { return base.GetByTreePId(treePId, eagerLoad) as MonthPlanList; }
/// <summary> /// 查询所有的根节点。 /// </summary> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> public EntityList GetTreeRoots(EagerLoadOptions eagerLoad = null) { return(this.DoGetTreeRoots(eagerLoad)); }
public new ProductAttachementList GetAll(PagingInfo paging= null, EagerLoadOptions eagerLoad = null) { return base.GetAll(paging, eagerLoad) as ProductAttachementList; }
protected virtual EntityList DoGetAll(PagingInfo paging, EagerLoadOptions eagerLoad) { return((EntityList)_dataProvider.GetAll(paging, eagerLoad)); }
public new ProductAttachementList GetByIdList(object[] idList, EagerLoadOptions eagerLoad = null) { return base.GetByIdList(idList, eagerLoad) as ProductAttachementList; }
protected virtual Entity DoGetFirst(EagerLoadOptions eagerLoad) { return((Entity)_dataProvider.GetAll(null, eagerLoad)); }
public new ProductAttachementList GetByTreeParentIndex(string treeIndex, EagerLoadOptions eagerLoad = null) { return base.GetByTreeParentIndex(treeIndex, eagerLoad) as ProductAttachementList; }
protected virtual Entity DoGetById(object id, EagerLoadOptions eagerLoad) { return(_dataProvider.GetById(id, eagerLoad)); }
public new ProductAttachement GetFirst(EagerLoadOptions eagerLoad = null) { return base.GetFirst(eagerLoad) as ProductAttachement; }
protected virtual EntityList DoGetTreeRoots(EagerLoadOptions eagerLoad) { return((EntityList)_dataProvider.GetTreeRoots(eagerLoad)); }
/// <summary> /// 贪婪加载某个属性 /// </summary> /// <param name="property">需要贪婪加载的托管属性。可以是一个引用属性,也可以是一个组合子属性。</param> private void EagerLoad(ConcreteProperty property) { if (this.EagerLoadOptions == null) { this.EagerLoadOptions = new EagerLoadOptions(); } this.EagerLoadOptions.CoreList.Add(property); }
protected virtual EntityList DoGetByIdList(object[] idList, EagerLoadOptions eagerLoad) { return(_dataProvider.GetByIdList(idList, eagerLoad)); }
public new OperationAC GetById(object id, EagerLoadOptions eagerLoad = null) { return base.GetById(id, eagerLoad) as OperationAC; }
protected virtual EntityList DoGetByParentIdList(object[] parentIdList, PagingInfo paging, EagerLoadOptions eagerLoad) { return(_dataProvider.GetByParentIdList(parentIdList, paging, eagerLoad)); }
public new OperationACList GetByParentId(object parentId, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { return base.GetByParentId(parentId, paging, eagerLoad) as OperationACList; }
protected virtual EntityList DoGetByParentId(object parentId, PagingInfo paging, EagerLoadOptions eagerLoad) { return((EntityList)_dataProvider.GetByParentId(parentId, paging, eagerLoad)); }
public new OperationACList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null) { return base.GetByTreePId(treePId, eagerLoad) as OperationACList; }
protected virtual EntityList DoGetByTreePId(object treePId, EagerLoadOptions eagerLoad) { return(_dataProvider.GetByTreePId(treePId, eagerLoad)); }
public new ChapterList GetAll(PagingInfo paging= null, EagerLoadOptions eagerLoad = null) { return base.GetAll(paging, eagerLoad) as ChapterList; }
protected virtual EntityList DoGetAllTreeParents(string treeIndex, EagerLoadOptions eagerLoad) { return(_dataProvider.GetAllTreeParents(treeIndex, eagerLoad)); }
public new ChapterList GetByIdList(object[] idList, EagerLoadOptions eagerLoad = null) { return base.GetByIdList(idList, eagerLoad) as ChapterList; }
public new MonthPlanList GetAll(PagingInfo paging= null, EagerLoadOptions eagerLoad = null) { return base.GetAll(paging, eagerLoad) as MonthPlanList; }
public new ChapterList GetByTreeParentIndex(string treeIndex, EagerLoadOptions eagerLoad = null) { return base.GetByTreeParentIndex(treeIndex, eagerLoad) as ChapterList; }
public new MonthPlan GetById(object id, EagerLoadOptions eagerLoad = null) { return base.GetById(id, eagerLoad) as MonthPlan; }
public new Chapter GetFirst(EagerLoadOptions eagerLoad = null) { return base.GetFirst(eagerLoad) as Chapter; }
/// <summary> /// 使用 sql 语句来查询实体。 /// </summary> /// <param name="sql">sql 语句,返回的结果集的字段,需要保证与属性映射的字段名相同。</param> /// <param name="paging">分页信息。</param> /// <param name="eagerLoad">需要贪婪加载的属性。</param> /// <returns></returns> protected EntityList QueryList(FormattedSql sql, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { return(Queryer.QueryList(sql, paging, eagerLoad)); }