Wednesday, July 17, 2013

Use NHibernate to execute raw SQL

In some cases it’s a lot easier to just write a simple SQL statement instead of using LINQ, HQL or one of the other syntaxes that NHibernate supports.

Executing a raw SQL:

Converting the result to a typed object:

No comments: