示例#1
0
        void Application_Start(object sender, EventArgs e)
        {
            _containerProvider = new ContainerProvider(ContainerCreationExtentions.CreateNew().LoadDefaultPackage("KindergartenApp"));

            SessionFactoryHelper.CreateSessionFactoryWithDBUpdate();
            using (var session = SessionFactoryHelper.SessionFactory.OpenSession())
            {
                var exist = session.Query <Sensitivity>().Any();

                if (!exist)
                {
                    var s1 = new Sensitivity {
                        Description = "לקטוז"
                    };
                    var s2 = new Sensitivity {
                        Description = "גלוטן"
                    };
                    var s3 = new Sensitivity {
                        Description = "בוטנים"
                    };
                    var s4 = new Sensitivity {
                        Description = "אגוזים"
                    };
                    var s5 = new Sensitivity {
                        Description = "ביצים"
                    };
                    session.Save(s1);
                    session.Save(s2);
                    session.Save(s3);
                    session.Save(s4);
                    session.Save(s5);
                }
            }
        }