Ejemplo n.º 1
0
 private Tuple <DatabaseConfigurator, DatabaseMetaInfo> PrepareConfigurator()
 {
     using (var container = Db4oEmbedded.OpenFile(Databasename))
     {
         var assembly = new AssemblyName("New.Name")
         {
             CodeBase = Path.GetTempFileName()
         };
         var metaInfo =
             DatabaseMetaInfo.Create(container, assembly);
         return(Tuple.Create(DatabaseConfigurator.Create(metaInfo), metaInfo));
     }
 }
Ejemplo n.º 2
0
        private static Tuple <DatabaseConfigurator, DatabaseMetaInfo> GetConfig(string dbName)
        {
            var cfg = Db4oEmbedded.NewConfiguration();

            cfg.File.ReadOnly = true;
            using (var metaInfoDB = Db4oEmbedded.OpenFile(cfg, dbName))
            {
                var name   = TestUtils.NewName();
                var meta   = DatabaseMetaInfo.Create(metaInfoDB, TypeLoader.Create(new string[0]), name);
                var config = DatabaseConfigurator.Create(meta);
                return(Tuple.Create(config, meta));
            }
        }