Hi I am trying to return a collection of building domain.
private long _id;
private string _buildingName;
private IList<BasicRoom> _rooms;
I am using NHibernate and this mapping for the rooms
<bag name="rooms" table="tb_rooms" lazy="false">
<key column="buildingID"/>
<one-to-many class="Room"/>
</bag>
And I am calling the db like this;
Buildings = (List<Building>)session.CreateCriteria(typeof(Building)).AddOrder(Order.Asc("buildingName")).List<Building>();
The problem is I don't want the _rooms collection to be an IList but I need it to be a List. Alas, NHibernate requires that I use an Interface for collections. Any idea how to do this. I am new to .Net and thinking that maybe dropping NHibernate might be the way forward. I just need to get the collection typed as an List so I can move on. Any help much appreciated.