Example #1
0
 public virtual void AddWebLink(WebLink link)
 {
     //link.SiteData = this;
     WebLinks.Add(link);
 }
Example #2
0
        public void SetupData()
        {
            var sessionFactory = BootStrapper.CreateSessionFactory();
            using (var session = sessionFactory.OpenSession())
            {
                // populate the database
                using (var transaction = session.BeginTransaction())
                {
                    //site
                    //var site = new SiteData { Name = "csinc" };

                    //links
                    var link1 = new WebLink { URL = "http://semperfifund.org", Name = "semper fi fund", OpenNewWindow = true };
                    var link2 = new WebLink { URL = "http://www.woundedwarriorproject.org/", Name = "wounded warriors", OpenNewWindow = true };
                    var link3 = new WebLink { URL = "http://www.sunshineacres.org/", Name = "sunshine acres", OpenNewWindow = true };

                    SaveLinks(session, link1, link2, link3);

                    //pages
                    var page1 = new Page { Name = "first-page", Content = "this is test content", IsPublished = true };
                    var page2 = new Page { Name = "first-page", Content = "this is test content", IsPublished = true };
                    SavePages(session, page1, page2);

                    transaction.Commit();
                }
            }
        }