当前位置: 首页>>代码示例>>C#>>正文


C# IQueryableCollection类代码示例

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


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


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