Skip to content

Commit f6f8224

Browse files
author
Sergey Koshcheyev
committedFeb 5, 2007
NH-888 - added IQuery.SetGuid.
SVN: trunk@2606
1 parent 486e4d4 commit f6f8224

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed
 

‎src/NHibernate/IQuery.cs

+16
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,22 @@ public interface IQuery
510510
/// <param name="val">A non-null instance of a <see cref="DateTime"/>.</param>
511511
IQuery SetTimestamp( string name, DateTime val );
512512

513+
/// <summary>
514+
/// Bind an instance of a <see cref="Guid" /> to a named parameter
515+
/// using an NHibernate <see cref="GuidType"/>.
516+
/// </summary>
517+
/// <param name="position">The position of the parameter in the query string, numbered from <c>0</c></param>
518+
/// <param name="val">An instance of a <see cref="Guid"/>.</param>
519+
IQuery SetGuid( int position, Guid val );
520+
521+
/// <summary>
522+
/// Bind an instance of a <see cref="Guid" /> to a named parameter
523+
/// using an NHibernate <see cref="GuidType"/>.
524+
/// </summary>
525+
/// <param name="name">The name of the parameter</param>
526+
/// <param name="val">An instance of a <see cref="Guid"/>.</param>
527+
IQuery SetGuid( string name, Guid val );
528+
513529
/// <summary>
514530
/// Override the current session flush mode, just for this query.
515531
/// </summary>

‎src/NHibernate/Impl/AbstractQueryImpl.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,19 @@ public IQuery SetTimestamp( string name, DateTime val )
373373
return this;
374374
}
375375

376-
public IQuery SetEntity( string name, object val )
376+
public IQuery SetGuid(string name, Guid val)
377+
{
378+
SetParameter(name, val, NHibernateUtil.Guid);
379+
return this;
380+
}
381+
382+
public IQuery SetGuid(int position, Guid val)
383+
{
384+
SetParameter(position, val, NHibernateUtil.Guid);
385+
return this;
386+
}
387+
388+
public IQuery SetEntity(string name, object val)
377389
{
378390
SetParameter( name, val, NHibernateUtil.Entity( NHibernateProxyHelper.GuessClass( val ) ) );
379391
return this;

0 commit comments

Comments
 (0)