Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            var helper = new NHibernateHelper();
            var export = new SchemaExport(helper.Configuration);
            export.Create(true, false);
            return;
            ISession session = helper.GetSession();

            //Class c = null;
            //var tran = session.BeginTransaction();
            //try
            //{

            //    TestInsertData2(session,ref c);
            //    session.Flush();
            //    tran.Commit();
            //}
            //catch (Exception ex)
            //{
            //    tran.Rollback();
            //    session.Clear();
            //    Console.WriteLine(ex.Message);
            //}

            ITransaction tran2 = session.BeginTransaction();
            try
            {
                TestInsertData(session);
                tran2.Commit();
            }
            catch (Exception ex)
            {
                tran2.Rollback();
                Console.WriteLine(ex.Message);
            }
            session.Close();
        }
Exemplo n.º 2
0
 public BaseTest()
 {
     helper = new NHibernateHelper();
 }
Exemplo n.º 3
0
 private void ShowCreateDbSql()
 {
     var helper = new NHibernateHelper();
     var export = new SchemaExport(helper.Configuration);
     export.Create(true,false);
 }