Hi, I am trying to return a collection of a construction domain.
private long _id;
private string _buildingName;
private IList<BasicRoom> _rooms;
I am using NHibernate and this mapping is for rooms
<bag name="rooms" table="tb_rooms" lazy="false">
<key column="buildingID"/>
<one-to-many class="Room"/>
</bag>
And I call db as follows:
Buildings = (List<Building>)session.CreateCriteria(typeof(Building)).AddOrder(Order.Asc("buildingName")).List<Building>();
The problem is that I donβt want the _rooms collection to be an IList, but I need it to be a list. Alas, NHibernate requires me to use the collection interface. Any ideas how to do this. I am new to .Net and I think that maybe dropping NHibernate could be a further step forward. I just need to get a collection typed as a list so that I can move on. Any help is greatly appreciated.
source
share