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


C# IList.GetEffectiveParameterLocations方法代码示例

本文整理汇总了C#中IList.GetEffectiveParameterLocations方法的典型用法代码示例。如果您正苦于以下问题:C# IList.GetEffectiveParameterLocations方法的具体用法?C# IList.GetEffectiveParameterLocations怎么用?C# IList.GetEffectiveParameterLocations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IList的用法示例。


在下文中一共展示了IList.GetEffectiveParameterLocations方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Bind

		public override void Bind(IDbCommand command, IList<Parameter> multiSqlQueryParametersList, int singleSqlParametersOffset, IList<Parameter> sqlQueryParametersList, QueryParameters queryParameters, ISessionImplementor session)
		{
			TypedValue typedValue = queryParameters.NamedParameters[name];
			string backTrackId = GetIdsForBackTrack(session.Factory).First(); // just the first because IType suppose the oders in certain sequence
			foreach (int position in sqlQueryParametersList.GetEffectiveParameterLocations(backTrackId))
			{
				ExpectedType.NullSafeSet(command, GetPagingValue(typedValue.Value, session.Factory.Dialect, queryParameters), position + singleSqlParametersOffset, session);
			}
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:9,代码来源:NamedParameterSpecification.cs

示例2: Bind

		public void Bind(IDbCommand command, IList<Parameter> multiSqlQueryParametersList, int singleSqlParametersOffset, IList<Parameter> sqlQueryParametersList, QueryParameters queryParameters, ISessionImplementor session)
		{
			IType type = keyType;
			object value = queryParameters.PositionalParameterValues[queryParameterPosition];

			string backTrackId = GetIdsForBackTrack(session.Factory).First(); // just the first because IType suppose the oders in certain sequence
			int position = sqlQueryParametersList.GetEffectiveParameterLocations(backTrackId).Single(); // an HQL positional parameter can't appear more than once
			type.NullSafeSet(command, value, position + singleSqlParametersOffset, session);
		}
开发者ID:Ruhollah,项目名称:nhibernate-core,代码行数:9,代码来源:CollectionFilterKeyParameterSpecification.cs

示例3: Bind

		public void Bind(IDbCommand command, IList<Parameter> multiSqlQueryParametersList, int singleSqlParametersOffset, IList<Parameter> sqlQueryParametersList, QueryParameters queryParameters, ISessionImplementor session)
		{
			TypedValue typedValue = queryParameters.NamedParameters[name];
			string backTrackId = GetIdsForBackTrack(session.Factory).First();
			foreach (int position in sqlQueryParametersList.GetEffectiveParameterLocations(backTrackId))
			{
				ExpectedType.NullSafeSet(command, typedValue.Value, position + singleSqlParametersOffset, session);
			}
		}
开发者ID:Ruhollah,项目名称:nhibernate-core,代码行数:9,代码来源:CriteriaNamedParameterSpecification.cs

示例4: Bind

		public void Bind(IDbCommand command, IList<Parameter> multiSqlQueryParametersList, int singleSqlParametersOffset, IList<Parameter> sqlQueryParametersList, QueryParameters queryParameters, ISessionImplementor session)
		{
			string backTrackId = GetIdsForBackTrack(session.Factory).First(); // just the first because IType suppose the oders in certain sequence

			// The same filterName-parameterName can appear more than once in the whole query
			object value = session.GetFilterParameterValue(filterParameterFullName);
			foreach (int position in multiSqlQueryParametersList.GetEffectiveParameterLocations(backTrackId))
			{
				ExpectedType.NullSafeSet(command, value, position, session);
			}
		}
开发者ID:khaliyo,项目名称:Spring.net-NHibernate.net-Asp.net-MVC-DWZ-,代码行数:11,代码来源:DynamicFilterParameterSpecification.cs

示例5: Bind

		public void Bind(IDbCommand command, IList<Parameter> multiSqlQueryParametersList, int singleSqlParametersOffset, IList<Parameter> sqlQueryParametersList, QueryParameters queryParameters, ISessionImplementor session)
		{
			// The QuerySkipParameterSpecification is unique so we can use multiSqlQueryParametersList
			var effectiveParameterLocations = multiSqlQueryParametersList.GetEffectiveParameterLocations(limitParametersNameForThisQuery).ToArray();
			if (effectiveParameterLocations.Length > 0)
			{
				// if the dialect does not support variable limits the parameter may was removed
				int value = Loader.Loader.GetOffsetUsingDialect(queryParameters.RowSelection, session.Factory.Dialect) ?? queryParameters.RowSelection.FirstRow;
				int position = effectiveParameterLocations[0];
				type.NullSafeSet(command, value, position, session);
			}
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:12,代码来源:QuerySkipParameterSpecification.cs

示例6: Bind

		public void Bind(IDbCommand command, IList<Parameter> multiSqlQueryParametersList, int singleSqlParametersOffset, IList<Parameter> sqlQueryParametersList, QueryParameters queryParameters, ISessionImplementor session)
		{
			// The QueryTakeParameterSpecification is unique so we can use multiSqlQueryParametersList
			var effectiveParameterLocations = multiSqlQueryParametersList.GetEffectiveParameterLocations(limitParametersNameForThisQuery).ToArray();
			if (effectiveParameterLocations.Any())
			{
				// if the dialect does not support variable limits the parameter may was removed
				int value = queryParameters.RowSelection.MaxRows;
				int position = effectiveParameterLocations.Single();
				type.NullSafeSet(command, value, position, session);
			}
		}
开发者ID:vcaraulean,项目名称:nhibernate-core,代码行数:12,代码来源:QueryTakeParameterSpecification.cs

示例7: Bind

		public override void Bind(IDbCommand command, IList<Parameter> multiSqlQueryParametersList, int singleSqlParametersOffset, IList<Parameter> sqlQueryParametersList, QueryParameters queryParameters, ISessionImplementor session)
		{
			IType type = ExpectedType;
			object value = queryParameters.PositionalParameterValues[hqlPosition];

			string backTrackId = GetIdsForBackTrack(session.Factory).First(); // just the first because IType suppose the oders in certain sequence
			// an HQL positional parameter can appear more than once because a custom HQL-Function can duplicate it
			foreach (int position in sqlQueryParametersList.GetEffectiveParameterLocations(backTrackId))
			{
				type.NullSafeSet(command, GetPagingValue(value, session.Factory.Dialect, queryParameters), position + singleSqlParametersOffset, session);
			}
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:12,代码来源:PositionalParameterSpecification.cs

示例8: GetQueryParameterTypes

		public static SqlType[] GetQueryParameterTypes(this IEnumerable<IParameterSpecification> parameterSpecs, IList<Parameter> sqlQueryParametersList, ISessionFactoryImplementor factory)
		{
			// NOTE: if you have a NullReferenceException probably is because the IParameterSpecification does not have the ExpectedType; use ResetEffectiveExpectedType before call this method.
			
			// due to IType.NullSafeSet(System.Data.IDbCommand , object, int, ISessionImplementor) the SqlType[] is supposed to be in a certain sequence.
			// here we can check and evetually Assert (see AssertionFailure) the supposition because each individual Parameter has its BackTrackId.
			// Currently we just take the first BackTrackId of each IParameterSpecification
			IEnumerable<IType> typesSequence = from typeLocation in
			                                   	from specification in parameterSpecs
			                                   	let firstParameterId = specification.GetIdsForBackTrack(factory).First()
			                                   	let effectiveParameterLocations = sqlQueryParametersList.GetEffectiveParameterLocations(firstParameterId)
			                                   	from location in effectiveParameterLocations
			                                   	select new {Location = location, Type = specification.ExpectedType}
			                                   group typeLocation by typeLocation.Location
			                                   into locations
			                                   orderby locations.Key
			                                   select locations.First().Type;
			return typesSequence.SelectMany(t => t.SqlTypes(factory)).ToArray();
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:19,代码来源:ParametersBackTrackExtensions.cs

示例9: Bind

		public void Bind(IDbCommand command, IList<Parameter> sqlQueryParametersList, QueryParameters queryParameters, ISessionImplementor session)
		{
			int position = sqlQueryParametersList.GetEffectiveParameterLocations(IdBackTrack).Single(); // version parameter can't appear more than once
			type.NullSafeSet(command, type.Seed(session), position, session);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:5,代码来源:VersionTypeSeedParameterSpecification.cs


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