public override void Apply(IEngineConfigurationType type)
        {
            var typeProvider =
                mConfigurationProvider.GetConfigurationTypes().Where(x => x.GetConfigurationType() == type.RegisteredType)
                .FirstOrDefault();

            if (typeProvider != null && typeProvider.GetFactory() != null)
            {
                type.SetFactory(typeProvider.GetFactory());
            }
            else if (type.GetFactory() == null)
            {
                // Activator.CreateInstance as a last resort
                Type fallbackType = typeof(FallbackObjectFactory <>).MakeGenericType(type.RegisteredType);
                type.SetFactory(new DatasourceFactory(fallbackType));
            }
        }
        public override void Apply(IEngineConfigurationType type)
        {
            var typeProvider =
                mConfigurationProvider.GetConfigurationTypes().Where(x => x.GetConfigurationType() == type.RegisteredType)
                    .FirstOrDefault();

            if(typeProvider != null && typeProvider.GetFactory() != null)
            {
                type.SetFactory(typeProvider.GetFactory());
            }
            else if (type.GetFactory() == null)
            {
                // Activator.CreateInstance as a last resort
                Type fallbackType = typeof (FallbackObjectFactory<>).MakeGenericType(type.RegisteredType);
                type.SetFactory(new DatasourceFactory(fallbackType));
            }
        }
 public void SetFactory(Type factory)
 {
     mType.SetFactory(new DatasourceFactory(factory));
 }