Exemplo n.º 1
0
        static void Execute(SchemaManagerOptions options)
        {
            var    sm     = new SchemaManager(options);
            string script = string.Empty;

            switch (_operation)
            {
            case Operation.Create:
                script = sm.Create();
                break;

            case Operation.Update:
                script = sm.Update();
                break;

            case Operation.Delete:
                script = sm.Drop();
                break;

            default:
                script = sm.Create();
                break;
            }

            if (options.Mode == SchemaManagerMode.Silent || _verbose)
            {
                Console.WriteLine(script);
            }
        }
        public void TestAssemlbyWithModelsCreate()
        {
            var options = new SchemaManagerOptions()
            {
                Mode = SchemaManagerMode.Execute,
                MappingAssemblies = new List <string>()
                {
                    BaseDirectory + @"\TestData\TestAssemblyWithModels\bin\Debug\TestAssemblyWithModels.dll"
                },
                ConfigFile = BaseDirectory + @"\TestData\hibernate.cfg.xml"
            };

            var sm = new SchemaManager(options);

            sm.Create();

            Assert.Pass();
        }