The SingleResultOperator result operator is not current supported

Description

SingleOrDefault on IQueryable doesnt work.

Throws an exception "The SingleResultOperator result operator is not current supported"

Also not it says Current instead of Currently. Doh

Below is some code I changed in source to make SingleOrDefault work.

NHIbernate\Linq\QueryModelVisitor.cs Line 154

private void ProcessServerSideResultOperator(ResultOperatorBase resultOperator)
{
if (resultOperator is FirstResultOperator || resultOperator is SingleResultOperator) // BUG FIX
{
ProcessFirstOperator();
}
else if (resultOperator is TakeResultOperator)
{
ProcessTakeOperator((TakeResultOperator)resultOperator);
}
else if (resultOperator is SkipResultOperator)
{
ProcessSkipOperator((SkipResultOperator)resultOperator);
}
else if (resultOperator is GroupResultOperator)
{
ProcessGroupByOperator((GroupResultOperator)resultOperator);
}
else
{
throw new NotSupportedException(string.Format("The {0} result operator is not current supported",
resultOperator.GetType().Name));
}
}

Environment

None

Assignee

Unassigned

Reporter

Chris Hampson

Labels

None

Components

Affects versions

Priority

Blocker
Configure