Example #1
0
        /// <summary>
        /// Registers an instance of the <see cref="IServiceContainerFactory"/> to use with TService
        /// </summary>
        /// <param name="factory">the factory instance</param>
        /// <typeparam name="TService">the service that will be created with the factory</typeparam>
        public static void RegisterServiceFactory <TService>(IServiceContainerFactory factory)
        {
            var item = GetFactory <TService>();

            if (item.IsNull())
            {
                ImplementationCache.TryAdd(typeof(TService), factory);
            }
        }
Example #2
0
 public static void RegisterServiceFactoryAsDefault(IServiceContainerFactory factory)
 {
     DefaultServiceContainerFactory = factory;
 }