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); }
public new RoleList GetByIdList(object[] idList, EagerLoadOptions eagerLoad = null) { return(base.GetByIdList(idList, eagerLoad) as RoleList); }
public new Role GetFirst(EagerLoadOptions eagerLoad = null) { return(base.GetFirst(eagerLoad) as Role); }
public new TestUserList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null) { return(base.GetByTreePId(treePId, eagerLoad) as TestUserList); }
public new TestUserList GetByParentId(object parentId, PagingInfo paging = null, EagerLoadOptions eagerLoad = null) { return(base.GetByParentId(parentId, paging, eagerLoad) as TestUserList); }
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; }
public new Folder GetFirst(EagerLoadOptions eagerLoad = null) { return(base.GetFirst(eagerLoad) as Folder); }
public new StorageMoveList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null) { return(base.GetByTreePId(treePId, eagerLoad) as StorageMoveList); }
public new StorageMoveList GetByTreeParentIndex(string treeIndex, EagerLoadOptions eagerLoad = null) { return(base.GetByTreeParentIndex(treeIndex, eagerLoad) as StorageMoveList); }
public new StorageMove GetFirst(EagerLoadOptions eagerLoad = null) { return(base.GetFirst(eagerLoad) as StorageMove); }
public new StorageMove GetById(object id, EagerLoadOptions eagerLoad = null) { return(base.GetById(id, eagerLoad) as StorageMove); }
public new City GetFirst(EagerLoadOptions eagerLoad = null) { return(base.GetFirst(eagerLoad) as City); }
/// <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; }
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; }
public new DataDict GetFirst(EagerLoadOptions eagerLoad = null) { return(base.GetFirst(eagerLoad) as DataDict); }
public new City GetById(object id, EagerLoadOptions eagerLoad = null) { return(base.GetById(id, eagerLoad) as City); }
public new DataDictList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null) { return(base.GetByTreePId(treePId, eagerLoad) as DataDictList); }
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); }
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); }
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); }
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); }
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$; }
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; }
public new Position GetFirst(EagerLoadOptions eagerLoad = null) { return(base.GetFirst(eagerLoad) as Position); }
public new PositionList GetByTreePId(object treePId, EagerLoadOptions eagerLoad = null) { return(base.GetByTreePId(treePId, eagerLoad) as PositionList); }
/// <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); }