protected void Init()
        {
            var configuration = new Memory.Configuration {
                ObjectFactory = new ObjectFactory(MetaPopulation.Instance, typeof(C1).Assembly, "Allors.Domain")
            };
            var database = new Database(configuration);

            this.session = database.CreateSession();
        }
示例#2
0
        public void SetUp()
        {
            var configuration = new Configuration {
                ObjectFactory = Config.ObjectFactory
            };

            Config.Default = new Database(configuration);

            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
        }
示例#3
0
        protected Database(Configuration configuration)
        {
            this.objectFactory = configuration.ObjectFactory;
            if (this.objectFactory == null)
            {
                throw new Exception("Configuration.ObjectFactory is missing");
            }

            this.concreteClassesByObjectType = new Dictionary<IObjectType, object>();

            this.id = string.IsNullOrWhiteSpace(configuration.Id) ? Guid.NewGuid().ToString("N").ToLowerInvariant() : configuration.Id;
        }
示例#4
0
        /// <summary>
        /// The init.
        /// </summary>
        /// <param name="populate">
        /// The setup.
        /// </param>
        protected void Setup(bool populate)
        {
            var configuration = new Configuration {
                ObjectFactory = Config.ObjectFactory
            };

            Config.Default = new Database(configuration);

            var database = Config.Default;

            database.Init();

            this.Session = Config.Default.CreateSession();

            if (populate)
            {
                new Setup(this.Session, null).Apply();
                this.Session.Commit();
            }
        }