NHibernate IList to List

前端 未结 3 1697
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 11:27

Hi I am trying to return a collection of building domain.

private long _id;
private string _buildingName;
private IList _rooms;
3条回答
  •  抹茶落季
    2021-01-03 12:06

    How about using the constructor of List that takes an IEnumerable? Then you can use:

    Buildings = new List(session.CreateCriteria(typeof(Building)).AddOrder(Order.Asc("buildingName")).List());
    

提交回复
热议问题