本文整理汇总了C#中NHibernate.Engine.QueryParameters.ValidateParameters方法的典型用法代码示例。如果您正苦于以下问题:C# QueryParameters.ValidateParameters方法的具体用法?C# QueryParameters.ValidateParameters怎么用?C# QueryParameters.ValidateParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NHibernate.Engine.QueryParameters
的用法示例。
在下文中一共展示了QueryParameters.ValidateParameters方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateFailureDifferentLengths
public void ValidateFailureDifferentLengths()
{
QueryParameters qp = new QueryParameters(
new IType[] {NHibernateUtil.String},
new object[] {});
Assert.Throws<QueryException>(() => qp.ValidateParameters());
}
示例2: ValidateOk
public void ValidateOk()
{
QueryParameters qp = new QueryParameters(
new IType[] {NHibernateUtil.String},
new object[] {"string"});
qp.ValidateParameters();
}
示例3: ValidateFailureDifferentLengths
public void ValidateFailureDifferentLengths()
{
QueryParameters qp = new QueryParameters(
new IType[] { NHibernateUtil.String },
new object[] { });
qp.ValidateParameters();
}
示例4: ValidateNullParameters
public void ValidateNullParameters()
{
QueryParameters qp = new QueryParameters(null, null);
qp.ValidateParameters();
}
示例5: Find
public IList Find( string query, QueryParameters parameters )
{
CheckIsOpen();
if( log.IsDebugEnabled )
{
log.Debug( "find: " + query );
parameters.LogParameters( factory );
}
parameters.ValidateParameters();
QueryTranslator[ ] q = GetQueries( query, false );
IList results = new ArrayList();
dontFlushFromFind++; //stops flush being called multiple times if this method is recursively called
//execute the queries and return all result lists as a single list
try
{
for( int i = 0; i < q.Length; i++ )
{
IList currentResults;
try
{
currentResults = q[ i ].List( this, parameters );
}
catch( Exception e )
{
throw new ADOException( "Could not execute query", e );
}
for( int j = 0; j < results.Count; j++ )
{
currentResults.Add( results[ j ] );
}
results = currentResults;
}
}
finally
{
dontFlushFromFind--;
}
return results;
}