示例#1
0
        static void Main(string[] args)
        {
            EsentDatabase.Settings settings = new EsentDatabase.Settings()
            {
                maxConcurrentSessions = 1,
                folderLocation        = Environment.ExpandEnvironmentVariables(@"%APPDATA%\EsentDemoApp")
            };

            using (var pool = EsentDatabase.open(settings, typeof(Program).Assembly))
                using (var sess = pool.GetSession())
                {
                    if (pool.isNewDatabase)
                    {
                        Person.populateWithDebugData(sess);
                        FiltersTest.populateWithDebugData(sess);
                    }
                    RunTests(sess);
                }
        }
示例#2
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         using (var db = EsentDatabase.open(typeof(Person).GetTypeInfo().Assembly))
             using (var sess = db.GetSession())
             {
                 if (db.isNewDatabase)
                 {
                     Person.populateWithDebugData(sess);
                     FiltersTest.populateWithDebugData(sess);
                 }
                 testPersons(sess);
                 // testFilters( sess );
             }
     }
     catch (Exception ex)
     {
         Debug.WriteLine("Failed: {0}", ex.Message);
     }
 }