Hi, I need to pass some objects to .Net and a Flex presentation layer.
I need to pass and obtain the passed object.
Public class room: Basicroom {Private int_setting cap; Type Private RoomType _ Room; Private IELIT & amp; the lift; Tools & gt; _equipment; Public virtual room type room {get {return _roomType; } Set {_roomType = value; }} Public Virtual ILITT & lt; Tools & gt; Tools {Get {Back _Avilment; } Set {_equipment = value; }} Public Virtual Ent Sitting Cap {get {return_seatingCap; } Set {_seatingCap = value; }}
Currently, I'm just passing in the above (domain object) presentation layer and it's okay. However, when I want to send the object back. I go into a problem. As
, I am using NHibernate as an orm tool so I use the interface in this case to map archives from IList. The problem arises when I return the object. On the Net-Gateway (Flash Remoting-Fluorine Fx) devices, Bolx is typed as an ILID and throws an error. "An example of an interface can not be made."
I need to type the equipment for freedom and not the ILIST.
What are some ideas for coming around this? Would it be better to convert to DTO?
Do anyone have experience with this?
I am quite new on the net so any help / indication appreciated very much.
Do any set list require a set? Often, the collection properties are read-only - you can simply add
/ remove
/ clear them
...
Virtual
makes this complicated - usually I just do it:
public IList & lt; Foo & gt; Fuse {get; Private set;} Public bar () {// ctor Foos = new list & lt; Foo & gt; (); }
In this case, perhaps (because we do not want to call a virtual method in ctor):
Private IList & lt; Foo & gt; Less important things; Protected Virtual ILIT & lt; Foo & gt; CreateFooList () {New List Back < Foo & gt; (); } Public IList & lt; Foo & gt; Fuses {get {if (foos == null) foos = CreateFooList (); Return fuses; }}
If it still does not work, try a solid list type.
Comments
Post a Comment