• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IQueryableCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IQueryableCollection的典型用法代码示例。如果您正苦于以下问题:C# IQueryableCollection类的具体用法?C# IQueryableCollection怎么用?C# IQueryableCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IQueryableCollection类属于命名空间,在下文中一共展示了IQueryableCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SubselectOneToManyLoader

		public SubselectOneToManyLoader(IQueryableCollection persister, SqlString subquery, ICollection<EntityKey> entityKeys,
		                                QueryParameters queryParameters,
		                                ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
			: base(persister, BatchSizeForSubselectFetching, factory, enabledFilters)
		{
			keys = new object[entityKeys.Count];
			int i = 0;
			foreach (EntityKey entityKey in entityKeys)
			{
				keys[i++] = entityKey.Identifier;
			}

			// NH Different behavior: to deal with positionslParameter+NamedParameter+ParameterOfFilters
			namedParameters = new Dictionary<string, TypedValue>(queryParameters.NamedParameters);
			parametersSpecifications = queryParameters.ProcessedSqlParameters.ToList();
			var processedRowSelection = queryParameters.ProcessedRowSelection;
			SqlString finalSubquery = subquery;
			if (queryParameters.ProcessedRowSelection != null && !SubselectClauseExtractor.HasOrderBy(queryParameters.ProcessedSql))
			{
				// when the original query has an "ORDER BY" we can't re-apply the pagination.
				// This is a simplification, we should actually check which is the "ORDER BY" clause because when the "ORDER BY" is just for the PK we can re-apply "ORDER BY" and pagination.
				finalSubquery = GetSubSelectWithLimits(subquery, parametersSpecifications, processedRowSelection, namedParameters);
			}
			InitializeFromWalker(persister, finalSubquery, BatchSizeForSubselectFetching, enabledFilters, factory);

			types = queryParameters.PositionalParameterTypes;
			values = queryParameters.PositionalParameterValues;
		}
开发者ID:Ruhollah,项目名称:nhibernate-core,代码行数:28,代码来源:SubselectOneToManyLoader.cs


示例2: OneToManyLoader

		public OneToManyLoader(
			IQueryableCollection oneToManyPersister,
			ISessionFactoryImplementor session,
			IDictionary enabledFilters)
			: this(oneToManyPersister, 1, session, enabledFilters)
		{
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:7,代码来源:OneToManyLoader.cs


示例3: BasicCollectionJoinWalker

		public BasicCollectionJoinWalker(
			IQueryableCollection collectionPersister,
			int batchSize,
			SqlString subquery,
			ISessionFactoryImplementor factory,
			IDictionary enabledFilters)
			: base(factory, enabledFilters)
		{
			this.collectionPersister = collectionPersister;
			string alias = GenerateRootAlias(collectionPersister.Role);

			WalkCollectionTree(collectionPersister, alias);

			IList allAssociations = new ArrayList();

			ArrayHelper.AddAll(allAssociations, associations);
			allAssociations.Add(new OuterJoinableAssociation(
			                    	collectionPersister.CollectionType,
			                    	null,
			                    	null,
			                    	alias,
			                    	JoinType.LeftOuterJoin,
			                    	Factory,
			                    	enabledFilters
			                    	));
			InitPersisters(allAssociations, LockMode.None);
			InitStatementString(alias, batchSize, subquery);
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:28,代码来源:BasicCollectionJoinWalker.cs


示例4: InitStatementString

		private void InitStatementString( IQueryableCollection persister, string alias, IList associations, int batchSize, ISessionFactoryImplementor factory )
		{
			Suffixes = GenerateSuffixes( associations.Count );

			SqlStringBuilder whereString = WhereString( factory, alias, persister.KeyColumnNames, persister.KeyType, batchSize );
			if( persister.HasWhere )
			{
				whereString
					.Add( " and " )
					.Add( persister.GetSQLWhereString( alias ) );
			}

			JoinFragment ojf = MergeOuterJoins( associations );
			SqlSelectBuilder select = new SqlSelectBuilder( factory )
				.SetSelectClause(
				persister.SelectFragment( alias ).Append(
					SelectString( associations, factory ) ).ToString()
				)
				.SetFromClause( persister.TableName, alias )
				.SetWhereClause( whereString.ToSqlString() )
				.SetOuterJoins(
				ojf.ToFromFragmentString,
				ojf.ToWhereFragmentString
				);

			if( persister.HasOrdering )
			{
				select.SetOrderByClause( persister.GetSQLOrderByString( alias ) );
			}
			SqlString = select.ToSqlString();
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:31,代码来源:CollectionLoader.cs


示例5: BasicCollectionLoader

		public BasicCollectionLoader(
			IQueryableCollection collectionPersister,
			ISessionFactoryImplementor session,
			IDictionary<string, IFilter> enabledFilters)
			: this(collectionPersister, 1, session, enabledFilters)
		{
		}
开发者ID:pallmall,项目名称:WCell,代码行数:7,代码来源:BasicCollectionLoader.cs


示例6: InitializeFromWalker

		protected virtual void InitializeFromWalker(IQueryableCollection oneToManyPersister, SqlString subquery, int batchSize, IDictionary<string, IFilter> enabledFilters, ISessionFactoryImplementor factory)
		{
			JoinWalker walker = new OneToManyJoinWalker(oneToManyPersister, batchSize, subquery, factory, enabledFilters);
			InitFromWalker(walker);

			PostInstantiate();

			log.Debug("Static select for one-to-many " + oneToManyPersister.Role + ": " + SqlString);
		}
开发者ID:khaliyo,项目名称:Spring.net-NHibernate.net-Asp.net-MVC-DWZ-,代码行数:9,代码来源:OneToManyLoader.cs


示例7: BasicCollectionLoader

		protected BasicCollectionLoader(IQueryableCollection collectionPersister, int batchSize, SqlString subquery,
		                                ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
			: base(collectionPersister, factory, enabledFilters)
		{
			JoinWalker walker = new BasicCollectionJoinWalker(collectionPersister, batchSize, subquery, factory, enabledFilters);
			InitFromWalker(walker);

			PostInstantiate();

			log.Debug("Static select for collection " + collectionPersister.Role + ": " + SqlString);
		}
开发者ID:Mrding,项目名称:Ribbon,代码行数:11,代码来源:BasicCollectionLoader.cs


示例8: CollectionLoader

		public CollectionLoader( IQueryableCollection persister, int batchSize, ISessionFactoryImplementor factory )
			: base( factory.Dialect )
		{
			this.collectionPersister = persister;
			this.keyType = persister.KeyType;

			string alias = GenerateRootAlias( persister.Role );
			IList associations = WalkCollectionTree( persister, alias, factory );

			InitStatementString( persister, alias, associations, batchSize, factory );
			InitClassPersisters( associations );

			PostInstantiate();
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:14,代码来源:CollectionLoader.cs


示例9: CollectionElementLoader

		public CollectionElementLoader(IQueryableCollection collectionPersister, ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
			: base(factory, enabledFilters)
		{
			keyType = collectionPersister.KeyType;
			indexType = collectionPersister.IndexType;
			persister = (IOuterJoinLoadable)collectionPersister.ElementPersister;
			entityName = persister.EntityName;

			JoinWalker walker = new EntityJoinWalker(persister, ArrayHelper.Join(collectionPersister.KeyColumnNames, collectionPersister.IndexColumnNames), 1, LockMode.None, factory, enabledFilters);
			InitFromWalker(walker);

			PostInstantiate();

			log.Debug("Static select for entity " + entityName + ": " + SqlString);
		}
开发者ID:pallmall,项目名称:WCell,代码行数:15,代码来源:CollectionElementLoader.cs


示例10: OneToManyLoader

		public OneToManyLoader( IQueryableCollection collPersister, int batchSize, ISessionFactoryImplementor factory )
			: base( factory.Dialect )
		{
			collectionPersister = collPersister;
			idType = collectionPersister.KeyType;

			IOuterJoinLoadable persister = ( IOuterJoinLoadable ) collPersister.ElementPersister;

			string alias = GenerateRootAlias( collPersister.Role );
			IList associations = WalkTree( persister, alias, factory );

			InitStatementString( collPersister, persister, alias, associations, batchSize, factory );
			InitClassPersisters( persister, associations );

			PostInstantiate();
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:16,代码来源:OneToManyLoader.cs


示例11: ComponentCollectionCriteriaInfoProvider

		public ComponentCollectionCriteriaInfoProvider(IQueryableCollection persister)
		{
			this.persister = persister;
			if (!persister.ElementType.IsComponentType)
			{
				throw new ArgumentException("persister for role " + persister.Role + " is not a collection-of-component");
			}

			var componentType = (IAbstractComponentType) persister.ElementType;
			string[] names = componentType.PropertyNames;
			IType[] types = componentType.Subtypes;

			for (int i = 0; i < names.Length; i++)
			{
				subTypes.Add(names[i], types[i]);
			}
		}
开发者ID:jlevitt,项目名称:nhibernate-core,代码行数:17,代码来源:ComponentCollectionCriteriaInfoProvider.cs


示例12: SubselectOneToManyLoader

		public SubselectOneToManyLoader(IQueryableCollection persister, SqlString subquery, ICollection<EntityKey> entityKeys,
		                                QueryParameters queryParameters, IDictionary<string, int[]> namedParameterLocMap,
		                                ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
			: base(persister, 1, subquery, factory, enabledFilters)
		{
			keys = new object[entityKeys.Count];
			int i = 0;
			foreach (EntityKey entityKey in entityKeys)
			{
				keys[i++] = entityKey.Identifier;
			}

			namedParameters = queryParameters.NamedParameters;
			// NH Different behavior: to deal with positionslParameter+NamedParameter+ParameterOfFilters
			types = queryParameters.PositionalParameterTypes;
			values = queryParameters.PositionalParameterValues;
			this.namedParameterLocMap = namedParameterLocMap;
		}
开发者ID:nkmajeti,项目名称:nhibernate,代码行数:18,代码来源:SubselectOneToManyLoader.cs


示例13: OneToManyJoinWalker

		public OneToManyJoinWalker(IQueryableCollection oneToManyPersister, int batchSize, SqlString subquery,
		                           ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
			: base(factory, enabledFilters)
		{
			this.oneToManyPersister = oneToManyPersister;
			IOuterJoinLoadable elementPersister = (IOuterJoinLoadable) oneToManyPersister.ElementPersister;
			string alias = GenerateRootAlias(oneToManyPersister.Role);

			WalkEntityTree(elementPersister, alias);

			IList<OuterJoinableAssociation> allAssociations = new List<OuterJoinableAssociation>(associations);
			allAssociations.Add(
				new OuterJoinableAssociation(oneToManyPersister.CollectionType, null, null, alias, JoinType.LeftOuterJoin, null, Factory,
				                             new CollectionHelper.EmptyMapClass<string, IFilter>()));

			InitPersisters(allAssociations, LockMode.None);
			InitStatementString(elementPersister, alias, batchSize, subquery);
		}
开发者ID:Mrding,项目名称:Ribbon,代码行数:18,代码来源:OneToManyJoinWalker.cs


示例14: BasicCollectionJoinWalker

		public BasicCollectionJoinWalker(IQueryableCollection collectionPersister, int batchSize,
			SqlString subquery, ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
			: base(factory, enabledFilters)
		{
			this.collectionPersister = collectionPersister;
			string alias = GenerateRootAlias(collectionPersister.Role);

			WalkCollectionTree(collectionPersister, alias);

			IList<OuterJoinableAssociation> allAssociations = new List<OuterJoinableAssociation>(associations);

			// NH Different behavior : passing enabledFilters instead empty-filter
			allAssociations.Add(
				new OuterJoinableAssociation(collectionPersister.CollectionType, null, null, alias, JoinType.LeftOuterJoin, null, Factory,
				                             enabledFilters));

			InitPersisters(allAssociations, LockMode.None);
			InitStatementString(alias, batchSize, subquery);
		}
开发者ID:sulabh1985,项目名称:nhibernate-core,代码行数:19,代码来源:BasicCollectionJoinWalker.cs


示例15: CreateBatchingCollectionInitializer

		public static ICollectionInitializer CreateBatchingCollectionInitializer(IQueryableCollection persister,
		                                                                         int maxBatchSize,
		                                                                         ISessionFactoryImplementor factory,
		                                                                         IDictionary<string, IFilter> enabledFilters)
		{
			if (maxBatchSize > 1)
			{
				int[] batchSizesToCreate = ArrayHelper.GetBatchSizes(maxBatchSize);
				Loader[] loadersToCreate = new Loader[batchSizesToCreate.Length];
				for (int i = 0; i < batchSizesToCreate.Length; i++)
				{
					loadersToCreate[i] = new BasicCollectionLoader(persister, batchSizesToCreate[i], factory, enabledFilters);
				}
				return new BatchingCollectionInitializer(persister, batchSizesToCreate, loadersToCreate);
			}
			else
			{
				return new BasicCollectionLoader(persister, factory, enabledFilters);
			}
		}
开发者ID:nikson,项目名称:nhibernate-core,代码行数:20,代码来源:BatchingCollectionInitializer.cs


示例16: SubselectCollectionLoader

        public SubselectCollectionLoader(
            IQueryableCollection persister,
            SqlString subquery,
            ICollection entityKeys,
            QueryParameters queryParameters,
            IDictionary namedParameterLocMap,
            ISessionFactoryImplementor factory,
            IDictionary<string, IFilter> enabledFilters)
            : base(persister, 1, subquery, factory, enabledFilters)
        {
            keys = new object[entityKeys.Count];
            int i = 0;
            foreach (EntityKey entityKey in entityKeys)
            {
                keys[i++] = entityKey.Identifier;
            }

            namedParameters = queryParameters.NamedParameters;
            types = queryParameters.FilteredPositionalParameterTypes;
            values = queryParameters.FilteredPositionalParameterValues;
            this.namedParameterLocMap = namedParameterLocMap;
        }
开发者ID:zibler,项目名称:zibler,代码行数:22,代码来源:SubselectCollectionLoader.cs


示例17: WalkCollectionTree

		/// <summary>
		/// For a collection role, return a list of associations to be fetched by outerjoin
		/// </summary>
		protected void WalkCollectionTree(IQueryableCollection persister, string alias)
		{
			WalkCollectionTree(persister, alias, string.Empty, 0);
			//TODO: when this is the entry point, we should use an INNER_JOIN for fetching the many-to-many elements!
		}
开发者ID:rbirkby,项目名称:nhibernate-core,代码行数:8,代码来源:JoinWalker.cs


示例18: CreateElementJoin

		public FromElement CreateElementJoin(IQueryableCollection queryableCollection)
		{
			_implied = true; //TODO: always true for now, but not if we later decide to support elements() in the from clause
			_inElementsFunction = true;

			IType elementType = queryableCollection.ElementType;

			if (!elementType.IsEntityType)
			{
				throw new InvalidOperationException("Cannot create element join for a collection of non-entities!");
			}

			_queryableCollection = queryableCollection;

			SessionFactoryHelperExtensions sfh = _fromClause.SessionFactoryHelper;
			IEntityPersister entityPersister = queryableCollection.ElementPersister;
			string tableAlias = _fromClause.AliasGenerator.CreateName(entityPersister.EntityName);
			string associatedEntityName = entityPersister.EntityName;
			IEntityPersister targetEntityPersister = sfh.RequireClassPersister(associatedEntityName);

			// Create the FROM element for the target (the elements of the collection).
			FromElement destination = CreateAndAddFromElement(
				associatedEntityName,
				_classAlias,
				targetEntityPersister,
				(EntityType)queryableCollection.ElementType,
				tableAlias
				);

			// If the join is implied, then don't include sub-classes on the element.
			if (_implied)
			{
				destination.IncludeSubclasses = false;
			}

			_fromClause.AddCollectionJoinFromElementByPath(_path, destination);
			//		origin.addDestination(destination);
			// Add the query spaces.
			_fromClause.Walker.AddQuerySpaces(entityPersister.QuerySpaces);

			CollectionType type = queryableCollection.CollectionType;
			string role = type.Role;
			string roleAlias = _origin.TableAlias;

			string[] targetColumns = sfh.GetCollectionElementColumns(role, roleAlias);
			IAssociationType elementAssociationType = sfh.GetElementAssociationType(type);

			// Create the join element under the from element.
			JoinSequence joinSequence = sfh.CreateJoinSequence(_implied, elementAssociationType, tableAlias, JoinType.InnerJoin, targetColumns);
			FromElement elem = InitializeJoin(_path, destination, joinSequence, targetColumns, _origin, false);
			elem.UseFromFragment = true;	// The associated entity is implied, but it must be included in the FROM.
			elem.CollectionTableAlias = roleAlias;	// The collection alias is the role.
			return elem;
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:54,代码来源:FromElementFactory.cs


示例19: CollectionPropertyMapping

		public CollectionPropertyMapping(IQueryableCollection memberPersister)
		{
			this.memberPersister = memberPersister;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:4,代码来源:CollectionPropertyMapping.cs


示例20: CreateCollectionElementsJoin

		public FromElement CreateCollectionElementsJoin(IQueryableCollection queryableCollection,
																						 String collectionName)
		{
			JoinSequence collectionJoinSequence = _fromClause.SessionFactoryHelper.CreateCollectionJoinSequence(queryableCollection, collectionName);
			_queryableCollection = queryableCollection;
			return CreateCollectionJoin(collectionJoinSequence, null);
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:7,代码来源:FromElementFactory.cs



注:本文中的IQueryableCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IQueue类代码示例发布时间:2022-05-24
下一篇:
C# IQueryable类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap