Cast problem with LINQ
- by yigit
I'm tring to get my product's types to a list with Linq.
var types = (from t in NHibernateSession.Linq<Product>()
select t.Type).Distinct().ToList<Type>();
return types;
But its giving an Unable to cast object of type error
'...Domain.Product' to type '...Domain.Type'.
Please tell where am I going wrong.