Denis Morgan

Denis Morgan

  • NA
  • 72
  • 22.6k

Convert List to IList<T>

Sep 8 2020 1:18 AM
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)