private Domain BuildDomain(string version, DomainUpgradeMode upgradeMode)
        {
            var configuration = DomainConfigurationFactory.Create();

            configuration.UpgradeMode = upgradeMode;
            configuration.Types.Register(Assembly.GetExecutingAssembly(),
                                         "Xtensive.Orm.Tests.Upgrade.DataUpgrade.Model.Version" + version);
            configuration.Types.Register(typeof(Upgrader));
            using (Upgrader.Enable(version)) {
                var domain = Domain.Build(configuration);
                return(domain);
            }
        }
        private Domain BuildDomain(DomainUpgradeMode upgradeMode, params Type[] types)
        {
            var configuration = DomainConfigurationFactory.Create();

            configuration.UpgradeMode = upgradeMode;
            foreach (var type in types)
            {
                configuration.Types.Register(type);
            }
            configuration.Types.Register(typeof(Upgrader));
            using (Upgrader.Enable("1")) {
                var domain = Domain.Build(configuration);
                return(domain);
            }
        }
Beispiel #3
0
        private void BuildDomain(DomainUpgradeMode upgradeMode, params Type[] types)
        {
            if (domain != null)
            {
                domain.DisposeSafely();
            }

            var configuration = DomainConfigurationFactory.Create();

            configuration.UpgradeMode = upgradeMode;
            foreach (var type in types)
            {
                configuration.Types.Register(type);
            }
            configuration.Types.Register(typeof(Upgrader));
            using (Upgrader.Enable("1")) {
                domain = Domain.Build(configuration);
            }
        }