예제 #1
0
파일: Program.cs 프로젝트: ekicyou/pasta
        public static void test1()
        {
            //OdbConfiguration.SetDebugEnabled(true);
            OdbConfiguration.SetReconnectObjectsToSession(false);

            try
            {
                string file = "Test.NeoDatis";
                IOUtil.DeleteFile(file);
                ODB odb = ODBFactory.Open(file);
                OID oid = odb.Store(new Function("f1"));
                odb.Close();
                Console.WriteLine("Write Done!");

                odb = ODBFactory.Open(file);
                Objects <Function> functions = odb.GetObjects <Function>();
                Console.WriteLine(" Number of functions = " + functions.Count);
                Function f = (Function)odb.GetObjectFromId(oid);
                Console.WriteLine(f.ToString());
                odb.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            Console.ReadLine();
        }