I do not know how to store the collection (Comments) in a separate table. By default, comments are serialized and stored in the SomeClass table as the Comments column.
[{Id: 0, CreateDate: 2013-09-12T14: 28: 37.0456202 + 02: 00, SomeClassID: 1, CommentText: "text-to-text",}]
Is it possible to save it in separate tables?
public class SomeClass { [AutoIncrement] public int Id { get; set; } public string Title { get; set; } List<Comment> comments = new List<Comment>(); public List<Comment> Comments { get { return comments; } set { comments = value; } } } public class Comment { [AutoIncrement] public int Id { get; set; } [References(typeof(SomeClass))] public int SomeClassID { get; set; } [StringLength(4000)] public string CommentText { get; set; } }
source share