Ejemplo n.º 1
0
        void ImportBlog(IDocumentStore store, BlogMLBlog blog)
        {
            var config = BlogConfig.New();

            config.Title           = blog.Title;
            config.Subtitle        = blog.SubTitle;
            config.Copyright       = String.Join(", ", blog.Authors.Select(author => author.Title));
            config.MetaDescription = String.Join(", ", blog.Categories.Select(category => category.Title));

            using (var session = store.OpenSession())
            {
                session.Store(config);
                session.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        private static void CreateConfig(IDocumentStore store)
        {
            using (IDocumentSession s = store.OpenSession())
            {
                var config = BlogConfig.New();
                config.Id         = "Blog/Config";
                config.CustomCss  = "hibernatingrhinos";
                config.Subtitle   = "Unnatural acts on source code";
                config.Title      = "Ayende @ Rahien";
                config.Copyright  = "Ayende Rahien";
                config.AkismetKey = "43f0db211711";

                s.Store(config);
                s.SaveChanges();
            }
        }
Ejemplo n.º 3
0
 //
 // GET: /Welcome/
 public virtual ActionResult Index()
 {
     return(AssertConfigurationIsNeeded() ?? View(BlogConfig.New()));
 }