Hi I need to pass some objects to and from .Net and a Flex presentation layer.
I need to pass and recieve the following object.
public class Room: BasicRoom
{
private int _seatingCap;
private RoomType _roomType;
private IList<Equipment> _equipment;
public virtual RoomType roomType
{
get { return _roomType; }
set { _roomType = value; }
}
public virtual IList<Equipment> equipment
{
get { return _equipment; }
set { _equipment = value; }
}
public virtual int seatingCap
{
get { return _seatingCap; }
set { _seatingCap = value; }
}
Currently, I am just passing the above (domain object) to the presentation layer and that is fine. However, when I want to send the object back to .Net I run into a problem.
As, I'm using NHibernate as the orm tool it requires me to use an interface in this case IList to map collections. The problem arises when I try to pass the object back to .Net - the gateway (flash remoting - fluorineFX) baulks at equipment being typed as an IList and throws the error. "Cannot create an instance of an interface".
I obvously need to type equipment to List and not IList.
What are some ideas to get around this? Would it be better to convert to dto's?
Has anyone had experience with this?
I am fairly new to .Net so any help/pointers much appreciated.