When looking at our queries from NHibernate it's clear that the column alias is not consistent, that a problem for performance when the sql server execution plan seeing the same query as different query's because of the inconsistent column alias.
An example could be something like this:
SELECT this_.Id as Id44_0_ FROM dbo.[Foos] this_
SELECT this_.Id as Id43_0_ FROM dbo.[Foos] this_
Is there any way we can make consistent column alias?
We are using Fluent NHibernate with Auto mapping
Optionally by setting projection you can get a custom name as an alias in the query as follows
Projections.Property("candidate.Name"), "CandidateName");
How to use NHibernate Projections to retrieve a collection
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With