Пример #1
0
        protected EntityFactoryConstructor GetConstructorEntry(Type entityType)
        {
            EntityFactoryConstructor constructor = typeToConstructorMap.Get(entityType);

            if (constructor == null)
            {
                try
                {
                    EntityFactoryWithArgumentConstructor argumentConstructor = AccessorTypeProvider.GetConstructorType <EntityFactoryWithArgumentConstructor>(entityType);
                    constructor = new EntityFactoryToArgumentConstructor(argumentConstructor, Self);
                }
                catch (Exception)
                {
                    constructor = AccessorTypeProvider.GetConstructorType <EntityFactoryConstructor>(entityType);
                }
                typeToConstructorMap.Put(entityType, constructor);
            }
            return(constructor);
        }
Пример #2
0
 public EntityFactoryToArgumentConstructor(EntityFactoryWithArgumentConstructor constructor, IEntityFactory entityFactory)
 {
     this.constructor   = constructor;
     this.entityFactory = entityFactory;
 }