public class BlogPost
{
public string Id { get; set; }
public string Title { get; set; }
public string Category { get; set; }
public string Content { get; set; }
public DateTime PublishedAt { get; set; }
public string[] Tags { get; set; }
public BlogComment[] Comments { get; set; }
}
public class BlogComment
{
public string Id{get;set;}
public string Title { get; set; }
public string Content { get; set; }
}
BlogPost post = new BlogPost()
{
Title = "Hello RavenDB",
Category = "RavenDB",
Content = "This is a blog about RavenDB",
Comments = new BlogComment[]
{
new BlogComment() {Title = "Unrealistic", Content = "This example is unrealistic"},
new BlogComment() {Title = "Nice", Content = "This example is nice"}
}
};
Persisting this will result in a BlogComment field being embedded in The BlogPost document
RavenDB Will not generate the Id for the BlogComment Field
What i actually want is for BlogPost to Hold just a reference to the BlogComment Field and for the BlogComment instance to be stored as a seperate entity
Any hint will do
thanks. I had to edit to Correctly represent my predicament