...doesn't work. It says there are circular references, when in fact
there are none.

Here is my model:

    public class Product : Entity
    {
        public virtual string Name { get; set; }
    }

    public class Prospect : Entity
    {
        public virtual string Sex { get; set; }
        public virtual string Initials { get; set; }
        public virtual string LastName { get; set; }
        public virtual int HouseNo { get; set; }
        public virtual Product Product { get; set; }
    }


As you can see, its a simple one.

When using the JS Serializer on it:

var serialize = (new JavaScriptSerializer()).Serialize(list);


it brakes with "A circular reference was detected while serializing an
object of type "System.Reflection.Module""

As soon as I slim down my model to exclude "Product" entity from being
mapped (so that its a normal child entity), it works ok.

The best thing I can conclude is that its because of Castle's proxy's.


Did anyone tackle this problem? I've seen solutions for JSON.Net, but
as the application on which I am working is working with built in MS
MVC action results (one of them being Json action result)...it
automatically uses that for serialization.

Any ideas?



Vladan

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to