Im trying to select only some fields from my table with code like this
IList<Product> res = sess.QueryOver<Product>()
.Select(x =>x.name)
.List<Product>();
No errors with this code but in runtime i got this: “Unable to perform find[SQL: SQL not available]” the value “Prod1 is not of type SympleFlhLINQ.Product and and cannot be used on this generic collection”.
And will be very nice if someone tell me how i can fetch only product name and referenced category name width something like this
IList<Product> res = sess.QueryOver<Product>()
.Select(x =>x.name)
.Select(x=>x.Cat.CategoryName)
.List<Product>();
or