Skip to content

NH-3137 - NHibernate Linq First() does not parametrize TOP criteria (MsSql2008) #738

@nhibernate-bot

Description

@nhibernate-bot

Morten Brix Pedersen created an issue — 30th April 2012, 14:38:18:

Using a query such as:

var firstRow = session.Query().Where(x => x.SomePredicate).First();

The generated SQL has "TOP 1", but the 1 should be parametrized using @p0.

This is a performance improvement since the server can re-use the same execution plan for queries.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions