Exemplo n.º 1
0
        /// <summary>Replaces all filter providers in services with <see cref="DryIocFilterProvider"/>, and registers it in container.</summary>
        /// <param name="container">DryIoc container.</param> <param name="services">Services</param>
        public static void SetFilterProvider(this IContainer container, ServicesContainer services)
        {
            var providers = services.GetFilterProviders();

            services.RemoveAll(typeof(IFilterProvider), _ => true);
            var filterProvider = new DryIocFilterProvider(container, providers);

            container.UseInstance <IFilterProvider>(filterProvider);
        }
 /// <summary>Replaces all filter providers in services with <see cref="DryIocFilterProvider"/>, and registers it in container.</summary>
 /// <param name="container">DryIoc container.</param> <param name="services">Services</param>
 public static void SetFilterProvider(this IContainer container, ServicesContainer services)
 {
     var providers = services.GetFilterProviders();
     services.RemoveAll(typeof(IFilterProvider), _ => true);
     var filterProvider = new DryIocFilterProvider(container, providers);
     services.Add(typeof(IFilterProvider), filterProvider);
     container.RegisterInstance<IFilterProvider>(filterProvider);
 }