I'm using Ef 4.1 and I've got a POCO object I'd like to serialize to JSON, I've read there is a problem to do so when using lazy loading but I'm not sure I can because a Message
can have a collection of Message
.
Is there any way to do this? sirialize this kind of object into JSON?
My Message
object looks like:
public class Message
{
[Key]
public int Id { get; set; }
public int? ParentId { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? LastModified { get; set; }
public virtual User User { get; set; }
public virtual Message Parent { get; set; }
public virtual ICollection<Message> Children { get; set; }
}