protected void Page_Load(object sender, EventArgs e) { _session = Global.documentStore.OpenSession(); var blog = _session.Load<Model.Blog>(1); var blogPost = new Model.BlogPost { Title = "Blog Post 1", CreatedOn = DateTime.Now, IsPublished = true }; blog.BlogPosts = new List<Model.BlogPost>(); blog.BlogPosts.Add(blogPost); _session.Store(blogPost); _session.SaveChanges(); this.btnDisc.Click += new EventHandler(btnDisc_Click); this.btnLoadDisc.Click += new EventHandler(btnLoadDisc_Click); }
protected void Page_Load(object sender, EventArgs e) { _session = Global.documentStore.OpenSession(); var blog = _session.Load <Model.Blog>(1); var blogPost = new Model.BlogPost { Title = "Blog Post 1", CreatedOn = DateTime.Now, IsPublished = true }; blog.BlogPosts = new List <Model.BlogPost>(); blog.BlogPosts.Add(blogPost); _session.Store(blogPost); _session.SaveChanges(); this.btnDisc.Click += new EventHandler(btnDisc_Click); this.btnLoadDisc.Click += new EventHandler(btnLoadDisc_Click); }