Is it possible to do something like this in NHibernate?
Product GetSpecificProduct()
{
return session.CreateSQLQuery("SELECT * FROM Products WHERE price =
$500").UniqueResult<Product>();
}
When I try to run this code I get:
System.InvalidCastException: Unable to cast object of type 'System.Object[]' to type Product.
Or do I have to use the NHibernate query language ?