Ejemplo n.º 1
0
        /// <summary>
        /// Adds resource handling
        /// </summary>
        /// <param name="serviceCollection"></param>
        /// <param name="configureOptions"></param>
        /// <returns></returns>
        public static IServiceCollection AddFimsResourceHandling(this IServiceCollection serviceCollection,
                                                                 Action <ResourceHandlerRegistryOptions> configureOptions = null)
        {
            // create registry options for service collection
            var opts = new ResourceHandlerRegistryOptions(serviceCollection);

            // apply any configuration
            configureOptions?.Invoke(opts);

            return
                (serviceCollection.AddScoped <IResourceHandlerRegistry, ResourceHandlerRegistry>()
                 .AddScoped(svcProvider => opts.Configure(svcProvider)));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Instantiates a <see cref="ResourceHandlerRegistry"/>
 /// </summary>
 /// <param name="options"></param>
 public ResourceHandlerRegistry(ResourceHandlerRegistryOptions options)
 {
     Options = options;
 }