Skip to content

Commit dbb5476

Browse files
unknownOnurGumus
unknown
authored andcommitted
add lockresult operator
1 parent f30427e commit dbb5476

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/NHibernate/Linq/ReWriters/ResultOperatorRewriter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ private class ResultOperatorExpressionRewriter : ExpressionTreeVisitor
6767
typeof(OfTypeResultOperator),
6868
typeof(CacheableResultOperator),
6969
typeof(TimeoutResultOperator),
70+
typeof (LockResultOperator),
7071
typeof(CastResultOperator), // see ProcessCast class
7172
};
7273

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace NHibernate.Linq.Visitors.ResultOperatorProcessors
7+
{
8+
internal class ProcessLock : IResultOperatorProcessor<LockResultOperator>
9+
{
10+
public void Process(LockResultOperator resultOperator, QueryModelVisitor queryModelVisitor, IntermediateHqlTree tree)
11+
{
12+
tree.AddAdditionalCriteria((q, p) => q.SetLockMode(queryModelVisitor.Model.MainFromClause.ItemName, (LockMode)resultOperator.LockMode.Value));
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)