Example #1
0
 public void UpdateConfig(BlogConfig blogConfig)
 {
     using (var session = RavenDocumentStore.OpenSession())
     {
         blogConfig.Id = "Blog/Config";
         session.Store(blogConfig);
     }
 }
Example #2
0
 public BlogConfig GetConfig()
 {
     using (var session = RavenDocumentStore.OpenSession())
     {
         var blogConfig = session.Load<BlogConfig>("Blog/Config");
         if (blogConfig == null)
         {
             blogConfig = new BlogConfig();
             blogConfig.Id = "Blog/Config";
             session.Store(blogConfig);
             session.SaveChanges();
         }
         return blogConfig;
     }
 }