Skip to content

Add a missing short circuit in query parameter expansion. #1548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/NHibernate/Impl/ExpressionQueryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ protected override IQueryExpression ExpandParameters(IDictionary<string, TypedVa
map.Add(name, aliases);
}

if (map.Count == 0)
{
// No list parameter needs to be replaced: they are all single valued. They just need
// to be retyped, which has been done above.
return QueryExpression;
}

//TODO: Do we need to translate expression one more time here?
var newTree = ParameterExpander.Expand(QueryExpression.Translate(Session.Factory, false), map);
var key = new StringBuilder(QueryExpression.Key);
Expand Down