protected override sealed EntityList DoGetAll(PagingInfo paging, EagerLoadOptions eagerLoad)
        {
            if (!PagingInfo.IsNullOrEmpty(paging)) { throw new NotSupportedException(); }

            DataProvider.EnsureStore();
            var items = DataProvider._memoryRows.Values.Select(v => DataProvider.FromRow(v));
            var list = this.CreateList(items, false);
            TreeHelper.MarkTreeFullLoaded(list);

            return list;
        }
        /// <summary>
        /// 通过本地 Id 查找实体。
        /// </summary>
        /// <param name="id"></param>
        /// <param name="eagerLoad">需要贪婪加载的属性。</param>
        /// <returns></returns>
        protected override sealed Entity DoGetById(object id, EagerLoadOptions eagerLoad)
        {
            DataProvider.EnsureStore();

            var row = DataProvider._memoryRows.Values.FirstOrDefault(e => e.Id.Equals(id));
            if (row == null) return null;
            //if (row == null)
            //{
            //    //如果还没有加载,则主动加载所有实体,然后再找到其中的那个。
            //    row = this.GetAll().FirstOrDefault(e => e.Id.Equals(id));
            //    if (row == null) { throw new InvalidOperationException("没有找到对应 id 的实体,可能是还没有通过仓库获取该实体。"); }
            //}

            return DataProvider.FromRow(row);
        }
Exemple #3
0
 public new RoleList GetByIdList(object[] idList, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByIdList(idList, eagerLoad) as RoleList);
 }
Exemple #4
0
 public new Role GetFirst(EagerLoadOptions eagerLoad = null)
 {
     return(base.GetFirst(eagerLoad) as Role);
 }
Exemple #5
0
 public new TestUserList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByTreePId(treePId, eagerLoad) as TestUserList);
 }
Exemple #6
0
 public new TestUserList GetByParentId(object parentId, PagingInfo paging = null, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByParentId(parentId, paging, eagerLoad) as TestUserList);
 }
Exemple #7
0
 public new TestUser GetById(object id, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetById(id, eagerLoad) as TestUser);
 }
 public new $domainEntityName$List GetAll(PagingInfo paging= null, EagerLoadOptions eagerLoad = null)
 {
     return base.GetAll(paging, eagerLoad) as $domainEntityName$List;
 }
Exemple #9
0
 public new Folder GetFirst(EagerLoadOptions eagerLoad = null)
 {
     return(base.GetFirst(eagerLoad) as Folder);
 }
Exemple #10
0
 public new StorageMoveList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByTreePId(treePId, eagerLoad) as StorageMoveList);
 }
Exemple #11
0
 public new StorageMoveList GetByTreeParentIndex(string treeIndex, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByTreeParentIndex(treeIndex, eagerLoad) as StorageMoveList);
 }
Exemple #12
0
 public new StorageMove GetFirst(EagerLoadOptions eagerLoad = null)
 {
     return(base.GetFirst(eagerLoad) as StorageMove);
 }
Exemple #13
0
 public new StorageMove GetById(object id, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetById(id, eagerLoad) as StorageMove);
 }
Exemple #14
0
 public new City GetFirst(EagerLoadOptions eagerLoad = null)
 {
     return(base.GetFirst(eagerLoad) as City);
 }
Exemple #15
0
 /// <summary>
 /// 使用 sql 语句来查询实体。
 /// </summary>
 /// <param name="sql">sql 语句,返回的结果集的字段,需要保证与属性映射的字段名相同。</param>
 /// <param name="paging">分页信息。</param>
 /// <param name="eagerLoad">需要贪婪加载的属性。</param>
 /// <returns></returns>
 public EntityList QueryList(FormattedSql sql, PagingInfo paging = null, EagerLoadOptions eagerLoad = null)
 {
     var args = new SqlQueryArgs(sql);
     args.SetDataLoadOptions(paging, eagerLoad);
     return this.QueryList(args);
 }
 public new $domainEntityName$List GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null)
 {
     return base.GetByTreePId(treePId, eagerLoad) as $domainEntityName$List;
 }
Exemple #17
0
 public new DataDict GetById(object id, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetById(id, eagerLoad) as DataDict);
 }
 public new $domainEntityName$List GetByIdList(object[] idList, EagerLoadOptions eagerLoad = null)
 {
     return base.GetByIdList(idList, eagerLoad) as $domainEntityName$List;
 }
Exemple #19
0
 public new DataDict GetFirst(EagerLoadOptions eagerLoad = null)
 {
     return(base.GetFirst(eagerLoad) as DataDict);
 }
Exemple #20
0
 public new City GetById(object id, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetById(id, eagerLoad) as City);
 }
Exemple #21
0
 public new DataDictList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByTreePId(treePId, eagerLoad) as DataDictList);
 }
Exemple #22
0
 public new TestUser GetFirst(EagerLoadOptions eagerLoad = null)
 {
     return(base.GetFirst(eagerLoad) as TestUser);
 }
 public new OrgPermissionUser GetById(object id, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetById(id, eagerLoad) as OrgPermissionUser);
 }
Exemple #24
0
 public new TestUserList GetByTreeParentIndex(string treeIndex, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByTreeParentIndex(treeIndex, eagerLoad) as TestUserList);
 }
 public new OrgPermissionUser GetFirst(EagerLoadOptions eagerLoad = null)
 {
     return(base.GetFirst(eagerLoad) as OrgPermissionUser);
 }
Exemple #26
0
 public new Role GetById(object id, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetById(id, eagerLoad) as Role);
 }
 public new OrgPermissionUserList GetAll(PagingInfo paging = null, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetAll(paging, eagerLoad) as OrgPermissionUserList);
 }
Exemple #28
0
 public new RoleList GetAll(PagingInfo paging = null, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetAll(paging, eagerLoad) as RoleList);
 }
 public new OrgPermissionUserList GetByIdList(object[] idList, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByIdList(idList, eagerLoad) as OrgPermissionUserList);
 }
Exemple #30
0
 public new RoleList GetByParentIdList(object[] parentIdList, PagingInfo paging = null, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByParentIdList(parentIdList, paging, eagerLoad) as RoleList);
 }
 public new OrgPermissionUserList GetByParentIdList(object[] parentIdList, PagingInfo paging = null, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByParentIdList(parentIdList, paging, eagerLoad) as OrgPermissionUserList);
 }
 public new $domainEntityName$List GetByTreeParentIndex(string treeIndex, EagerLoadOptions eagerLoad = null)
 {
     return base.GetByTreeParentIndex(treeIndex, eagerLoad) as $domainEntityName$List;
 }
 public new OrgPermissionUserList GetByTreeParentIndex(string treeIndex, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByTreeParentIndex(treeIndex, eagerLoad) as OrgPermissionUserList);
 }
 public new $domainEntityName$ GetFirst(EagerLoadOptions eagerLoad = null)
 {
     return base.GetFirst(eagerLoad) as $domainEntityName$;
 }
 public new OrgPermissionUserList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByTreePId(treePId, eagerLoad) as OrgPermissionUserList);
 }
 public new $domainEntityName$ GetById(object id, EagerLoadOptions eagerLoad = null)
 {
     return base.GetById(id, eagerLoad) as $domainEntityName$;
 }
Exemple #37
0
 public new Position GetById(object id, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetById(id, eagerLoad) as Position);
 }
 public new $domainEntityName$List GetByParentIdList(object[] parentIdList, PagingInfo paging = null, EagerLoadOptions eagerLoad = null)
 {
     return base.GetByParentIdList(parentIdList, paging, eagerLoad) as $domainEntityName$List;
 }
Exemple #39
0
 public new Position GetFirst(EagerLoadOptions eagerLoad = null)
 {
     return(base.GetFirst(eagerLoad) as Position);
 }
Exemple #40
0
 public new PositionList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null)
 {
     return(base.GetByTreePId(treePId, eagerLoad) as PositionList);
 }
Exemple #41
0
 /// <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 this.DataQueryer.QueryList(sql, paging, eagerLoad);
 }