How do I convert a non-Generic IList to IList?

前端 未结 7 1851
失恋的感觉
失恋的感觉 2021-02-02 06:20

I have class that wants an IList, but I have a Systems.Collection.IList, coming from an NHibernate quere.

I want to create a method th

7条回答
  •  春和景丽
    2021-02-02 06:49

    No need for use Linq in this case (OfType() or .Cast). NHibernate implementation is enough.

    You just have to use:

    var results= query.List();
    

    Instead of

    var results= query.List<>();
    

提交回复
热议问题