I have this query, and it should return double (that is in database as Decimal(10,2)
):
public products SearchPrice(string nmproduct)
{
string hql = "select x.custo from products x where x.nmproduct = ?";
IQuery query = session.CreateQuery(hql);
query.SetParameter(0, nmproduct);
return query.UniqueResult<products>();
}
I want to get the price in database.
The exception is:
Unable to cast object of type 'System.Decimal' to type 'Administrative.Models.products'.