[...]
If NHibernate has provided its own extension methods to be used in lieu
of System.Linq.Enumerable and those methods return IList<T> and IList,
then of course you cannot directly assign the return value to a
variable
declared as List<T>.
Traditional NHibernate is not LINQ.
Since the person posting as "Big Steel" has been specifically talking
about LINQ (e.g. "…nHibernate uses its own implementation of Linq…"), it
seems safe to assume that we are discussing "NHibernate LINQ", and not
"Traditional NHibernate". When I write "NHibernate" alone, you should
take that to refer to the former.
Well - I specifically stated "traditional NHibernate".
I don't think you should assume that when I explicit say X that I
really means Y.
[...]
As far as I can tell NHibernate LINQ works exactly like MS
intended.
IList<T1> res4 = (from t1 in s.Linq<T1>() select t1).ToList();
works.
But this would not:
List<T1> res4 = (from t1 in s.Linq<T1>() select t1).ToList();
This works as well.
But I can't see any reason to write it that way.
…if NHibernate is providing a different "ToList" extension method, that
returns an IList<T> instead of List<T> as the .NET one does.
In other words, "NHibernate LINQ" would _not_ work "exactly like MS
intended", assuming your previous statement about it returning IList<T>
instead of List<T> is correct.
Again: you will benefit from reading what I write. A little
back I wrote:
#In NHibernate LINQ a .ToList() returns an IList<T> (actually
#a List<T> that implements IList<T>, but ...).
It is beyond me how you can make that fit with "your previous
statement about it returning IList<T> instead of List<T> is correct".