本文整理匯總了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;
}