3
Answers

Convert List to IList<T>

Denis Morgan

Denis Morgan

4y
15.6k
1
I have a list of my model object from NHibernate result set and would wish to have a genric method to convert it to
IList<T>
 
I have this 
 
var l = session.CreateSQLQuery(@query).SetResultTransformer(Transformers.AliasToEntityMap).List();
 
need to convert to 
 
IList<T> ls = new List<T>();
 
such that any List returned from nhibernate can easly be matched to any model class
 
 
Answers (3)