Example #1
0
        protected virtual void ConfigureEntity(ITableConfig table)
        {
            var initializer = new EntityInitializer(table);
            var factory     = new EntityFactory(table, initializer);
            var entity      = factory.Create() as IEntityConfiguration;

            if (entity == null)
            {
                return;
            }
            entity.Configure(this, table);
        }
Example #2
0
        protected virtual IEntityFactory GetFactory(ITableConfig table)
        {
            var factory = default(IEntityFactory);

            if (!this.Factories.TryGetValue(table, out factory))
            {
                var initializer = new EntityInitializer(table);
                var populator   = new EntityPopulator(this.Database, table);
                factory = new EntityFactory(table, initializer, populator);
                this.Factories.Add(table, factory);
            }
            return(factory);
        }