I have a query by linq to NHibernate.
var q = SessionInstance.Query<Request>().Max(e => e.Code);
If Request
table has no rows, execution of this query raises GenericADOException with this message :
{"Could not execute query[SQL: SQL not available]"}
{"Value cannot be null.\r\nParameter name: item"}
What should I do?
x.Code
something else thanint?
? (I just want to learn, not promoting my own answer). – Commonable