zoukankan      html  css  js  c++  java
  • ASP.NET Core MVC内置服务的使用

    ASP.NET Core中的依赖注入可以说是无处不在,其通过创建一个ServiceCollection对象并将服务注册信息以ServiceDescriptor对象的形式添加在其中,其次针对ServiceCollection对象创建对应的ServiceProvider,通过ServiceProvider提供我们需要的服务实例。

    这里通过IServiceCollection来查看一下 其默认注册了哪些服务。

    • 1、使用asp.net core mvc默认模板,命令行创建项目
    dotnet new mvc -o projectname
    

    Microsoft.Extensions.DependencyInjection中提供很多IServiceCollection的扩展方法来添加服务注册。如:

    /// <summary>
    /// Adds MVC services to the specified <see cref="IServiceCollection" />.
    /// </summary>
    /// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
    /// <returns>An <see cref="IMvcBuilder"/> that can be used to further configure the MVC services.</returns>
    public static IMvcBuilder AddMvc(this IServiceCollection services)
    {
        if (services == null)
        {
            throw new ArgumentNullException(nameof(services));
        }
    
        services.AddControllersWithViews();
        return services.AddRazorPages();
    }
    
    public static IMvcBuilder AddControllers(this IServiceCollection services)
    {
        if (services == null)
        {
            throw new ArgumentNullException(nameof(services));
        }
    
        var builder = AddControllersCore(services);
        return new MvcBuilder(builder.Services, builder.PartManager);
    }
    
    • 2、在Startup.cs中 将IServiceCollection中注册的服务输出到日志
    private IServiceCollection _services;
    
    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }
    
    public IConfiguration Configuration { get; }
    
    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        services.Configure<CookiePolicyOptions>(options =>
        {
            // This lambda determines whether user consent for non-essential cookies is needed for a given request.
            options.CheckConsentNeeded = context => true;
            options.MinimumSameSitePolicy = SameSiteMode.None;
        });
    
    
        services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
    
        _services = services;
    
    }
    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
    {
        var _logger = loggerFactory.CreateLogger("Services");
        _logger.LogInformation($"Total Services Registered: {_services.Count}");
        foreach (var service in _services)
        {
            _logger.LogInformation($"Service: {service.ServiceType.FullName}
          Lifetime: {service.Lifetime}
          Instance: {service.ImplementationType?.FullName}");
        }
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseExceptionHandler("/Home/Error");
            // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
            app.UseHsts();
        }
    
        app.UseHttpsRedirection();
        app.UseStaticFiles();
        app.UseCookiePolicy();
    
        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");
        });
    }
    
    类型生命周期Instance
    Microsoft.AspNetCore.Hosting.Internal.WebHostOptionsSingleton
    Microsoft.AspNetCore.Hosting.IHostingEnvironmentSingleton
    Microsoft.Extensions.Hosting.IHostingEnvironmentSingleton
    Microsoft.AspNetCore.Hosting.WebHostBuilderContextSingleton
    Microsoft.Extensions.Configuration.IConfigurationSingleton
    Microsoft.AspNetCore.Hosting.Builder.IApplicationBuilderFactoryTransientMicrosoft.AspNetCore.Hosting.Builder.ApplicationBuilderFactory
    Microsoft.AspNetCore.Http.IHttpContextFactoryTransientMicrosoft.AspNetCore.Http.HttpContextFactory
    Microsoft.AspNetCore.Http.IMiddlewareFactoryScopedMicrosoft.AspNetCore.Http.MiddlewareFactory
    Microsoft.Extensions.Options.IOptions`1SingletonMicrosoft.Extensions.Options.OptionsManager`1
    Microsoft.Extensions.Options.IOptionsSnapshot`1ScopedMicrosoft.Extensions.Options.OptionsManager`1
    Microsoft.Extensions.Options.IOptionsMonitor`1SingletonMicrosoft.Extensions.Options.OptionsMonitor`1
    Microsoft.Extensions.Options.IOptionsFactory`1TransientMicrosoft.Extensions.Options.OptionsFactory`1
    Microsoft.Extensions.Options.IOptionsMonitorCache`1SingletonMicrosoft.Extensions.Options.OptionsCache`1
    Microsoft.Extensions.Logging.ILoggerFactorySingletonMicrosoft.Extensions.Logging.LoggerFactory
    Microsoft.Extensions.Logging.ILogger`1SingletonMicrosoft.Extensions.Logging.Logger`1
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.AspNetCore.Hosting.IStartupFilterTransientMicrosoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter
    Microsoft.Extensions.ObjectPool.ObjectPoolProviderSingletonMicrosoft.Extensions.ObjectPool.DefaultObjectPoolProvider
    Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal.ITransportFactorySingletonMicrosoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions, Microsoft.AspNetCore.Server.Kestrel.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Server.Kestrel.Core.Internal.KestrelServerOptionsSetup
    Microsoft.AspNetCore.Hosting.Server.IServerSingletonMicrosoft.AspNetCore.Server.Kestrel.Core.KestrelServer
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions, Microsoft.AspNetCore.Server.Kestrel.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.Extensions.Logging.Configuration.ILoggerProviderConfigurationFactorySingletonMicrosoft.Extensions.Logging.Configuration.LoggerProviderConfigurationFactory
    Microsoft.Extensions.Logging.Configuration.ILoggerProviderConfiguration`1SingletonMicrosoft.Extensions.Logging.Configuration.LoggerProviderConfiguration`1
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.Extensions.Logging.Configuration.LoggingConfigurationSingleton
    Microsoft.Extensions.Logging.ILoggerProviderSingletonMicrosoft.Extensions.Logging.Console.ConsoleLoggerProvider
    Microsoft.Extensions.Options.IConfigureOptions`1SingletonMicrosoft.Extensions.Logging.Console.ConsoleLoggerOptionsSetup
    Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions, Microsoft.Extensions.Logging.Console, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.Extensions.Logging.Configuration.LoggerProviderOptionsChangeTokenSource`2[[Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions, Microsoft.Extensions.Logging.Console, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider, Microsoft.Extensions.Logging.Console, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]
    Microsoft.Extensions.Logging.ILoggerProviderSingletonMicrosoft.Extensions.Logging.Debug.DebugLoggerProvider
    Microsoft.Extensions.Logging.EventSource.LoggingEventSourceSingleton
    Microsoft.Extensions.Logging.ILoggerProviderSingletonMicrosoft.Extensions.Logging.EventSource.EventSourceLoggerProvider
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.Extensions.Logging.EventLogFiltersConfigureOptions
    Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.Extensions.Logging.EventLogFiltersConfigureOptionsChangeSource
    Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.HostFiltering.HostFilteringOptions, Microsoft.AspNetCore.HostFiltering, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.AspNetCore.HostFiltering.HostFilteringOptions, Microsoft.AspNetCore.HostFiltering, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.AspNetCore.Hosting.IStartupFilterTransientMicrosoft.AspNetCore.HostFilteringStartupFilter
    Microsoft.Extensions.DependencyInjection.IServiceProviderFactory`1[[Microsoft.Extensions.DependencyInjection.IServiceCollection, Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.AspNetCore.Hosting.IStartupSingleton
    System.Diagnostics.DiagnosticListenerSingleton
    System.Diagnostics.DiagnosticSourceSingleton
    Microsoft.AspNetCore.Hosting.IApplicationLifetimeSingletonMicrosoft.AspNetCore.Hosting.Internal.ApplicationLifetime
    Microsoft.Extensions.Hosting.IApplicationLifetimeSingleton
    Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutorSingletonMicrosoft.AspNetCore.Hosting.Internal.HostedServiceExecutor
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Builder.CookiePolicyOptions, Microsoft.AspNetCore.CookiePolicy, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManagerSingleton
    Microsoft.AspNetCore.Routing.IInlineConstraintResolverTransientMicrosoft.AspNetCore.Routing.DefaultInlineConstraintResolver
    Microsoft.Extensions.ObjectPool.ObjectPool`1[[Microsoft.AspNetCore.Routing.Internal.UriBuildingContext, Microsoft.AspNetCore.Routing, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.AspNetCore.Routing.Tree.TreeRouteBuilderTransient
    Microsoft.AspNetCore.Routing.Internal.RoutingMarkerServiceSingletonMicrosoft.AspNetCore.Routing.Internal.RoutingMarkerService
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Routing.EndpointOptions, Microsoft.AspNetCore.Routing, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.Extensions.DependencyInjection.ConfigureEndpointOptions
    Microsoft.AspNetCore.Routing.CompositeEndpointDataSourceSingleton
    Microsoft.AspNetCore.Routing.ParameterPolicyFactorySingletonMicrosoft.AspNetCore.Routing.DefaultParameterPolicyFactory
    Microsoft.AspNetCore.Routing.Matching.MatcherFactorySingletonMicrosoft.AspNetCore.Routing.Matching.DfaMatcherFactory
    Microsoft.AspNetCore.Routing.Matching.DfaMatcherBuilderTransientMicrosoft.AspNetCore.Routing.Matching.DfaMatcherBuilder
    Microsoft.AspNetCore.Routing.Internal.DfaGraphWriterSingletonMicrosoft.AspNetCore.Routing.Internal.DfaGraphWriter
    Microsoft.AspNetCore.Routing.Matching.DataSourceDependentMatcher+LifetimeTransientMicrosoft.AspNetCore.Routing.Matching.DataSourceDependentMatcher+Lifetime
    Microsoft.AspNetCore.Routing.LinkGeneratorSingletonMicrosoft.AspNetCore.Routing.DefaultLinkGenerator
    Microsoft.AspNetCore.Routing.IEndpointAddressScheme`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]SingletonMicrosoft.AspNetCore.Routing.EndpointNameAddressScheme
    Microsoft.AspNetCore.Routing.IEndpointAddressScheme`1[[Microsoft.AspNetCore.Routing.RouteValuesAddress, Microsoft.AspNetCore.Routing, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Routing.RouteValuesAddressScheme
    Microsoft.AspNetCore.Routing.Matching.EndpointSelectorSingletonMicrosoft.AspNetCore.Routing.Matching.DefaultEndpointSelector
    Microsoft.AspNetCore.Routing.MatcherPolicySingletonMicrosoft.AspNetCore.Routing.Matching.HttpMethodMatcherPolicy
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.MvcCoreMvcOptionsSetup
    Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.Infrastructure.MvcOptionsConfigureCompatibilityOptions
    Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.MvcCoreMvcOptionsSetup
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.ApiBehaviorOptions, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.Internal.ApiBehaviorOptionsSetup
    Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.Mvc.ApiBehaviorOptions, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.Internal.ApiBehaviorOptionsSetup
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Routing.RouteOptions, Microsoft.AspNetCore.Routing, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.Internal.MvcCoreRouteOptionsSetup
    Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientMicrosoft.AspNetCore.Mvc.Internal.DefaultApplicationModelProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientMicrosoft.AspNetCore.Mvc.ApplicationModels.ApiBehaviorApplicationModelProvider
    Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProviderTransientMicrosoft.AspNetCore.Mvc.Internal.ControllerActionDescriptorProvider
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorCollectionProviderSingletonMicrosoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionSelectorSingletonMicrosoft.AspNetCore.Mvc.Internal.ActionSelector
    Microsoft.AspNetCore.Mvc.Internal.ActionConstraintCacheSingletonMicrosoft.AspNetCore.Mvc.Internal.ActionConstraintCache
    Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraintProviderTransientMicrosoft.AspNetCore.Mvc.Internal.DefaultActionConstraintProvider
    Microsoft.AspNetCore.Routing.MatcherPolicySingletonMicrosoft.AspNetCore.Mvc.Routing.ConsumesMatcherPolicy
    Microsoft.AspNetCore.Routing.MatcherPolicySingletonMicrosoft.AspNetCore.Mvc.Routing.ActionConstraintMatcherPolicy
    Microsoft.AspNetCore.Mvc.Controllers.IControllerFactorySingletonMicrosoft.AspNetCore.Mvc.Controllers.DefaultControllerFactory
    Microsoft.AspNetCore.Mvc.Controllers.IControllerActivatorTransientMicrosoft.AspNetCore.Mvc.Controllers.DefaultControllerActivator
    Microsoft.AspNetCore.Mvc.Controllers.IControllerFactoryProviderSingletonMicrosoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider
    Microsoft.AspNetCore.Mvc.Controllers.IControllerActivatorProviderSingletonMicrosoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider
    Microsoft.AspNetCore.Mvc.Internal.IControllerPropertyActivatorTransientMicrosoft.AspNetCore.Mvc.Internal.DefaultControllerPropertyActivator
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionInvokerFactorySingletonMicrosoft.AspNetCore.Mvc.Internal.ActionInvokerFactory
    Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProviderTransientMicrosoft.AspNetCore.Mvc.Internal.ControllerActionInvokerProvider
    Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCacheSingletonMicrosoft.AspNetCore.Mvc.Internal.ControllerActionInvokerCache
    Microsoft.AspNetCore.Mvc.Filters.IFilterProviderSingletonMicrosoft.AspNetCore.Mvc.Internal.DefaultFilterProvider
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultTypeMapperSingletonMicrosoft.AspNetCore.Mvc.Internal.ActionResultTypeMapper
    Microsoft.AspNetCore.Mvc.Internal.RequestSizeLimitFilterTransientMicrosoft.AspNetCore.Mvc.Internal.RequestSizeLimitFilter
    Microsoft.AspNetCore.Mvc.Internal.DisableRequestSizeLimitFilterTransientMicrosoft.AspNetCore.Mvc.Internal.DisableRequestSizeLimitFilter
    Microsoft.AspNetCore.Mvc.Internal.RequestFormLimitsFilterTransientMicrosoft.AspNetCore.Mvc.Internal.RequestFormLimitsFilter
    Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProviderSingletonMicrosoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider
    Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ICompositeMetadataDetailsProviderTransient
    Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinderFactorySingletonMicrosoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory
    Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IObjectModelValidatorSingleton
    Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCacheSingletonMicrosoft.AspNetCore.Mvc.Internal.ClientValidatorCache
    Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinderSingletonMicrosoft.AspNetCore.Mvc.ModelBinding.ParameterBinder
    Microsoft.AspNetCore.Mvc.Internal.MvcMarkerServiceSingletonMicrosoft.AspNetCore.Mvc.Internal.MvcMarkerService
    Microsoft.AspNetCore.Mvc.Internal.ITypeActivatorCacheSingletonMicrosoft.AspNetCore.Mvc.Internal.TypeActivatorCache
    Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactorySingletonMicrosoft.AspNetCore.Mvc.Routing.UrlHelperFactory
    Microsoft.AspNetCore.Mvc.Infrastructure.IHttpRequestStreamReaderFactorySingletonMicrosoft.AspNetCore.Mvc.Internal.MemoryPoolHttpRequestStreamReaderFactory
    Microsoft.AspNetCore.Mvc.Infrastructure.IHttpResponseStreamWriterFactorySingletonMicrosoft.AspNetCore.Mvc.Internal.MemoryPoolHttpResponseStreamWriterFactory
    System.Buffers.ArrayPool`1[[System.Byte, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]Singleton
    System.Buffers.ArrayPool`1[[System.Char, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]Singleton
    Microsoft.AspNetCore.Mvc.Infrastructure.OutputFormatterSelectorSingletonMicrosoft.AspNetCore.Mvc.Infrastructure.DefaultOutputFormatterSelector
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.ObjectResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.PhysicalFileResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.PhysicalFileResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.VirtualFileResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.VirtualFileResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.FileStreamResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.FileStreamResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.FileContentResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.FileContentResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.RedirectResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.RedirectResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.LocalRedirectResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.LocalRedirectResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.RedirectToActionResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.RedirectToActionResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.RedirectToRouteResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.RedirectToRouteResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.RedirectToPageResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.RedirectToPageResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.ContentResult, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.Infrastructure.ContentResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IClientErrorFactorySingletonMicrosoft.AspNetCore.Mvc.Infrastructure.ProblemDetailsClientErrorFactory
    Microsoft.AspNetCore.Mvc.Internal.MvcRouteHandlerSingletonMicrosoft.AspNetCore.Mvc.Internal.MvcRouteHandler
    Microsoft.AspNetCore.Mvc.Internal.MvcAttributeRouteHandlerTransientMicrosoft.AspNetCore.Mvc.Internal.MvcAttributeRouteHandler
    Microsoft.AspNetCore.Routing.EndpointDataSourceSingletonMicrosoft.AspNetCore.Mvc.Internal.MvcEndpointDataSource
    Microsoft.AspNetCore.Mvc.Internal.MvcEndpointInvokerFactorySingletonMicrosoft.AspNetCore.Mvc.Internal.MvcEndpointInvokerFactory
    Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterConfigurationProviderSingletonMicrosoft.AspNetCore.Mvc.Internal.MiddlewareFilterConfigurationProvider
    Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderSingletonMicrosoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilder
    Microsoft.AspNetCore.Hosting.IStartupFilterSingletonMicrosoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter
    Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionGroupCollectionProviderSingletonMicrosoft.AspNetCore.Mvc.ApiExplorer.ApiDescriptionGroupCollectionProvider
    Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionProviderTransientMicrosoft.AspNetCore.Mvc.ApiExplorer.DefaultApiDescriptionProvider
    Microsoft.AspNetCore.Authentication.IAuthenticationServiceScopedMicrosoft.AspNetCore.Authentication.AuthenticationService
    Microsoft.AspNetCore.Authentication.IClaimsTransformationSingletonMicrosoft.AspNetCore.Authentication.NoopClaimsTransformation
    Microsoft.AspNetCore.Authentication.IAuthenticationHandlerProviderScopedMicrosoft.AspNetCore.Authentication.AuthenticationHandlerProvider
    Microsoft.AspNetCore.Authentication.IAuthenticationSchemeProviderSingletonMicrosoft.AspNetCore.Authentication.AuthenticationSchemeProvider
    Microsoft.AspNetCore.Authorization.IAuthorizationServiceTransientMicrosoft.AspNetCore.Authorization.DefaultAuthorizationService
    Microsoft.AspNetCore.Authorization.IAuthorizationPolicyProviderTransientMicrosoft.AspNetCore.Authorization.DefaultAuthorizationPolicyProvider
    Microsoft.AspNetCore.Authorization.IAuthorizationHandlerProviderTransientMicrosoft.AspNetCore.Authorization.DefaultAuthorizationHandlerProvider
    Microsoft.AspNetCore.Authorization.IAuthorizationEvaluatorTransientMicrosoft.AspNetCore.Authorization.DefaultAuthorizationEvaluator
    Microsoft.AspNetCore.Authorization.IAuthorizationHandlerContextFactoryTransientMicrosoft.AspNetCore.Authorization.DefaultAuthorizationHandlerContextFactory
    Microsoft.AspNetCore.Authorization.IAuthorizationHandlerTransientMicrosoft.AspNetCore.Authorization.Infrastructure.PassThroughAuthorizationHandler
    Microsoft.AspNetCore.Authorization.Policy.IPolicyEvaluatorTransientMicrosoft.AspNetCore.Authorization.Policy.PolicyEvaluator
    Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientMicrosoft.AspNetCore.Mvc.Internal.AuthorizationApplicationModelProvider
    Microsoft.AspNetCore.Mvc.Formatters.FormatFilterSingletonMicrosoft.AspNetCore.Mvc.Formatters.FormatFilter
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.DataAnnotations.Internal.MvcDataAnnotationsMvcOptionsSetup
    Microsoft.AspNetCore.Mvc.DataAnnotations.IValidationAttributeAdapterProviderSingletonMicrosoft.AspNetCore.Mvc.DataAnnotations.ValidationAttributeAdapterProvider
    Microsoft.AspNetCore.DataProtection.Internal.IActivatorSingletonMicrosoft.AspNetCore.DataProtection.TypeForwardingActivator
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.DataProtection.KeyManagement.KeyManagementOptions, Microsoft.AspNetCore.DataProtection, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.DataProtection.Internal.KeyManagementOptionsSetup
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.DataProtection.DataProtectionOptions, Microsoft.AspNetCore.DataProtection, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.DataProtection.Internal.DataProtectionOptionsSetup
    Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManagerSingletonMicrosoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager
    Microsoft.AspNetCore.DataProtection.Infrastructure.IApplicationDiscriminatorSingletonMicrosoft.AspNetCore.DataProtection.Internal.HostingApplicationDiscriminator
    Microsoft.AspNetCore.Hosting.IStartupFilterSingletonMicrosoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter
    Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IDefaultKeyResolverSingletonMicrosoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver
    Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IKeyRingProviderSingletonMicrosoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider
    Microsoft.AspNetCore.DataProtection.IDataProtectionProviderSingleton
    Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolverSingletonMicrosoft.AspNetCore.DataProtection.XmlEncryption.CertificateResolver
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Antiforgery.AntiforgeryOptions, Microsoft.AspNetCore.Antiforgery, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Antiforgery.Internal.AntiforgeryOptionsSetup
    Microsoft.AspNetCore.Antiforgery.IAntiforgerySingletonMicrosoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgery
    Microsoft.AspNetCore.Antiforgery.Internal.IAntiforgeryTokenGeneratorSingletonMicrosoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgeryTokenGenerator
    Microsoft.AspNetCore.Antiforgery.Internal.IAntiforgeryTokenSerializerSingletonMicrosoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgeryTokenSerializer
    Microsoft.AspNetCore.Antiforgery.Internal.IAntiforgeryTokenStoreSingletonMicrosoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgeryTokenStore
    Microsoft.AspNetCore.Antiforgery.Internal.IClaimUidExtractorSingletonMicrosoft.AspNetCore.Antiforgery.Internal.DefaultClaimUidExtractor
    Microsoft.AspNetCore.Antiforgery.IAntiforgeryAdditionalDataProviderSingletonMicrosoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgeryAdditionalDataProvider
    Microsoft.Extensions.ObjectPool.ObjectPool`1[[Microsoft.AspNetCore.Antiforgery.Internal.AntiforgerySerializationContext, Microsoft.AspNetCore.Antiforgery, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    System.Text.Encodings.Web.HtmlEncoderSingleton
    System.Text.Encodings.Web.JavaScriptEncoderSingleton
    System.Text.Encodings.Web.UrlEncoderSingleton
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcViewOptions, Microsoft.AspNetCore.Mvc.ViewFeatures, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.ViewFeatures.Internal.MvcViewOptionsSetup
    Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcViewOptions, Microsoft.AspNetCore.Mvc.ViewFeatures, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.ViewFeatures.MvcViewOptionsConfigureCompatibilityOptions
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.ViewFeatures.Internal.TempDataMvcOptionsSetup
    Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngineSingletonMicrosoft.AspNetCore.Mvc.ViewEngines.CompositeViewEngine
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.ViewResult, Microsoft.AspNetCore.Mvc.ViewFeatures, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.PartialViewResult, Microsoft.AspNetCore.Mvc.ViewFeatures, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.PartialViewResultExecutor
    Microsoft.AspNetCore.Mvc.Internal.IControllerPropertyActivatorTransientMicrosoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionaryControllerPropertyActivator
    Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelperTransientMicrosoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper
    Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper`1TransientMicrosoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper`1
    Microsoft.AspNetCore.Mvc.ViewFeatures.IHtmlGeneratorSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.DefaultHtmlGenerator
    Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ExpressionTextCacheSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.Internal.ExpressionTextCache
    Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProviderSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.ModelExpressionProvider
    Microsoft.AspNetCore.Mvc.ViewFeatures.ValidationHtmlAttributeProviderSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.DefaultValidationHtmlAttributeProvider
    Microsoft.AspNetCore.Mvc.Rendering.IJsonHelperSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.JsonHelper
    Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatterSingleton
    Microsoft.AspNetCore.Mvc.ViewComponents.IViewComponentSelectorSingletonMicrosoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentSelector
    Microsoft.AspNetCore.Mvc.ViewComponents.IViewComponentFactorySingletonMicrosoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentFactory
    Microsoft.AspNetCore.Mvc.ViewComponents.IViewComponentActivatorSingletonMicrosoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentActivator
    Microsoft.AspNetCore.Mvc.ViewComponents.IViewComponentDescriptorCollectionProviderSingletonMicrosoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentDescriptorCollectionProvider
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.ViewComponentResult, Microsoft.AspNetCore.Mvc.ViewFeatures, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.ViewComponentResultExecutor
    Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewComponentInvokerCacheSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewComponentInvokerCache
    Microsoft.AspNetCore.Mvc.ViewComponents.IViewComponentDescriptorProviderTransientMicrosoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentDescriptorProvider
    Microsoft.AspNetCore.Mvc.ViewComponents.IViewComponentInvokerFactorySingletonMicrosoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvokerFactory
    Microsoft.AspNetCore.Mvc.IViewComponentHelperTransientMicrosoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentHelper
    Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientMicrosoft.AspNetCore.Mvc.ViewFeatures.TempDataApplicationModelProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientMicrosoft.AspNetCore.Mvc.ViewFeatures.ViewDataAttributeApplicationModelProvider
    Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.SaveTempDataFilterSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.Internal.SaveTempDataFilter
    Microsoft.AspNetCore.Mvc.ViewFeatures.ControllerSaveTempDataPropertyFilterTransientMicrosoft.AspNetCore.Mvc.ViewFeatures.ControllerSaveTempDataPropertyFilter
    Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataProviderSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.CookieTempDataProvider
    Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ValidateAntiforgeryTokenAuthorizationFilterSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.Internal.ValidateAntiforgeryTokenAuthorizationFilter
    Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.AutoValidateAntiforgeryTokenAuthorizationFilterSingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.Internal.AutoValidateAntiforgeryTokenAuthorizationFilter
    Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactorySingletonMicrosoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionaryFactory
    System.Buffers.ArrayPool`1[[Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewBufferValue, Microsoft.AspNetCore.Mvc.ViewFeatures, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton
    Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.IViewBufferScopeScopedMicrosoft.AspNetCore.Mvc.ViewFeatures.Internal.MemoryPoolViewBufferScope
    Microsoft.AspNetCore.Mvc.Razor.Internal.CSharpCompilerSingletonMicrosoft.AspNetCore.Mvc.Razor.Internal.CSharpCompiler
    Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorReferenceManagerSingletonMicrosoft.AspNetCore.Mvc.Razor.Internal.DefaultRazorReferenceManager
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcViewOptions, Microsoft.AspNetCore.Mvc.ViewFeatures, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.Razor.Internal.MvcRazorMvcViewOptionsSetup
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions, Microsoft.AspNetCore.Mvc.Razor, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.Razor.RazorViewEngineOptionsSetup
    Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions, Microsoft.AspNetCore.Mvc.Razor, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.Razor.RazorViewEngineOptionsSetup
    Microsoft.AspNetCore.Mvc.Razor.Internal.IRazorViewEngineFileProviderAccessorSingletonMicrosoft.AspNetCore.Mvc.Razor.Internal.DefaultRazorViewEngineFileProviderAccessor
    Microsoft.AspNetCore.Mvc.Razor.IRazorViewEngineSingleton
    Microsoft.AspNetCore.Mvc.Razor.Compilation.IViewCompilerProviderSingletonMicrosoft.AspNetCore.Mvc.Razor.Internal.RazorViewCompilerProvider
    Microsoft.AspNetCore.Mvc.Razor.Compilation.IViewCompilationMemoryCacheProviderSingletonMicrosoft.AspNetCore.Mvc.Razor.Compilation.RazorViewCompilationMemoryCacheProvider
    Microsoft.AspNetCore.Mvc.Razor.IRazorPageFactoryProviderTransientMicrosoft.AspNetCore.Mvc.Razor.Internal.DefaultRazorPageFactoryProvider
    Microsoft.AspNetCore.Mvc.Razor.Internal.LazyMetadataReferenceFeatureSingletonMicrosoft.AspNetCore.Mvc.Razor.Internal.LazyMetadataReferenceFeature
    Microsoft.AspNetCore.Razor.Language.RazorProjectFileSystemSingletonMicrosoft.AspNetCore.Mvc.Razor.Internal.FileProviderRazorProjectFileSystem
    Microsoft.AspNetCore.Razor.Language.RazorProjectEngineSingleton
    Microsoft.AspNetCore.Razor.Language.RazorProjectSingleton
    Microsoft.AspNetCore.Razor.Language.RazorTemplateEngineSingletonMicrosoft.AspNetCore.Mvc.Razor.Extensions.MvcRazorTemplateEngine
    Microsoft.AspNetCore.Razor.Language.RazorEngineSingleton
    Microsoft.AspNetCore.Mvc.Razor.IRazorPageActivatorSingletonMicrosoft.AspNetCore.Mvc.Razor.RazorPageActivator
    Microsoft.AspNetCore.Mvc.Razor.ITagHelperActivatorSingletonMicrosoft.AspNetCore.Mvc.Razor.Internal.DefaultTagHelperActivator
    Microsoft.AspNetCore.Mvc.Razor.TagHelpers.ITagHelperComponentPropertyActivatorSingletonMicrosoft.AspNetCore.Mvc.Razor.TagHelpers.TagHelperComponentPropertyActivator
    Microsoft.AspNetCore.Mvc.Razor.ITagHelperFactorySingletonMicrosoft.AspNetCore.Mvc.Razor.Internal.DefaultTagHelperFactory
    Microsoft.AspNetCore.Mvc.Razor.TagHelpers.ITagHelperComponentManagerScopedMicrosoft.AspNetCore.Mvc.Razor.Internal.TagHelperComponentManager
    Microsoft.Extensions.Caching.Memory.IMemoryCacheSingletonMicrosoft.Extensions.Caching.Memory.MemoryCache
    Microsoft.AspNetCore.Mvc.Razor.Infrastructure.TagHelperMemoryCacheProviderSingletonMicrosoft.AspNetCore.Mvc.Razor.Infrastructure.TagHelperMemoryCacheProvider
    Microsoft.AspNetCore.Mvc.ViewFeatures.IFileVersionProviderSingletonMicrosoft.AspNetCore.Mvc.Razor.Infrastructure.DefaultFileVersionProvider
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions, Microsoft.AspNetCore.Mvc.Razor, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.RazorPages.Internal.RazorPagesRazorViewEngineOptionsSetup
    Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.Mvc.RazorPages.RazorPagesOptions, Microsoft.AspNetCore.Mvc.RazorPages, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.RazorPages.RazorPagesOptionsConfigureCompatibilityOptions
    Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionDescriptorProvider
    Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorChangeProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Internal.PageActionDescriptorChangeProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IPageRouteModelProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Internal.RazorProjectPageRouteModelProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IPageRouteModelProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Internal.CompiledPageRouteModelProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelProviderSingletonMicrosoft.AspNetCore.Mvc.ApplicationModels.DefaultPageApplicationModelProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.AutoValidateAntiforgeryPageApplicationModelProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Internal.AuthorizationPageApplicationModelProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.TempDataFilterPageApplicationModelProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.ViewDataAttributePageApplicationModelProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Internal.ResponseCacheFilterApplicationModelProvider
    Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvokerProvider
    Microsoft.AspNetCore.Mvc.RazorPages.IPageModelActivatorProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Infrastructure.DefaultPageModelActivatorProvider
    Microsoft.AspNetCore.Mvc.RazorPages.IPageModelFactoryProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Infrastructure.DefaultPageModelFactoryProvider
    Microsoft.AspNetCore.Mvc.RazorPages.IPageActivatorProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Infrastructure.DefaultPageActivatorProvider
    Microsoft.AspNetCore.Mvc.RazorPages.IPageFactoryProviderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Infrastructure.DefaultPageFactoryProvider
    Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.IPageLoaderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Internal.DefaultPageLoader
    Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.IPageHandlerMethodSelectorSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Infrastructure.DefaultPageHandlerMethodSelector
    Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageArgumentBinderSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Internal.DefaultPageArgumentBinder
    Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageResultExecutorSingletonMicrosoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageResultExecutor
    Microsoft.AspNetCore.Mvc.RazorPages.PageSaveTempDataPropertyFilterTransientMicrosoft.AspNetCore.Mvc.RazorPages.PageSaveTempDataPropertyFilter
    Microsoft.AspNetCore.Mvc.TagHelpers.Cache.IDistributedCacheTagHelperStorageSingletonMicrosoft.AspNetCore.Mvc.TagHelpers.Cache.DistributedCacheTagHelperStorage
    Microsoft.AspNetCore.Mvc.TagHelpers.Cache.IDistributedCacheTagHelperFormatterSingletonMicrosoft.AspNetCore.Mvc.TagHelpers.Cache.DistributedCacheTagHelperFormatter
    Microsoft.AspNetCore.Mvc.TagHelpers.Cache.IDistributedCacheTagHelperServiceSingletonMicrosoft.AspNetCore.Mvc.TagHelpers.Cache.DistributedCacheTagHelperService
    Microsoft.Extensions.Caching.Distributed.IDistributedCacheSingletonMicrosoft.Extensions.Caching.Distributed.MemoryDistributedCache
    Microsoft.AspNetCore.Mvc.TagHelpers.Internal.CacheTagHelperMemoryCacheFactorySingletonMicrosoft.AspNetCore.Mvc.TagHelpers.Internal.CacheTagHelperMemoryCacheFactory
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.Formatters.Json.Internal.MvcJsonMvcOptionsSetup
    Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcJsonOptions, Microsoft.AspNetCore.Mvc.Formatters.Json, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMicrosoft.AspNetCore.Mvc.MvcJsonOptionsConfigureCompatibilityOptions
    Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionProviderTransientMicrosoft.AspNetCore.Mvc.Formatters.Json.JsonPatchOperationsArrayProvider
    Microsoft.AspNetCore.Mvc.Formatters.Json.Internal.JsonResultExecutorSingletonMicrosoft.AspNetCore.Mvc.Formatters.Json.Internal.JsonResultExecutor
    Microsoft.AspNetCore.Cors.Infrastructure.ICorsServiceTransientMicrosoft.AspNetCore.Cors.Infrastructure.CorsService
    Microsoft.AspNetCore.Cors.Infrastructure.ICorsPolicyProviderTransientMicrosoft.AspNetCore.Cors.Infrastructure.DefaultCorsPolicyProvider
    Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientMicrosoft.AspNetCore.Mvc.Cors.Internal.CorsApplicationModelProvider
    Microsoft.AspNetCore.Mvc.Cors.CorsAuthorizationFilterTransientMicrosoft.AspNetCore.Mvc.Cors.CorsAuthorizationFilter
    Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.Infrastructure.MvcCompatibilityOptions, Microsoft.AspNetCore.Mvc.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]Singleton

    • 3、我们能够直接获取这些服务的实例来使用,也可以使用第三方容器如:AspectCore、Autofac

    例:使用AspectCore

    public class AspectCoreContainer
    {
        private static IServiceResolver resolver { get; set; }
        public static IServiceProvider BuildServiceProvider(IServiceCollection services, Action<IAspectConfiguration> configure = null)
        {
            if(services==null)throw new ArgumentNullException(nameof(services));
            services.ConfigureDynamicProxy(configure);
            services.AddAspectCoreContainer();
            return resolver = services.ToServiceContainer().Build();
        }
    
        public static T Resolve<T>()
        {
            if (resolver == null)
                throw new ArgumentNullException(nameof(resolver), "调用此方法时必须先调用BuildServiceProvider!");
            return resolver.Resolve<T>();
        }
        public static List<T> ResolveServices<T>()
        {
            if (resolver == null)
                throw new ArgumentNullException(nameof(resolver), "调用此方法时必须先调用BuildServiceProvider!");
            return resolver.GetServices<T>().ToList();
        }
    }
    

    调用Resolve拿到实例

    var razorViewEngine = AspectCoreContainer.Resolve<IRazorViewEngine>();
    var compositeViewEngine = AspectCoreContainer.Resolve<ICompositeViewEngine>();
    var tempDataProvider = AspectCoreContainer.Resolve<ITempDataProvider>();
    var serviceProvider = AspectCoreContainer.Resolve<IServiceProvider>();
    var options = AspectCoreContainer.Resolve<IOptions>();
    
  • 相关阅读:
    第十四周 Leetcode 315. Count of Smaller Numbers After Self(HARD) 主席树
    POJ1050 To the Max 最大子矩阵
    POJ1259 The Picnic 最大空凸包问题 DP
    POJ 3734 Blocks 矩阵递推
    POJ2686 Traveling by Stagecoach 状态压缩DP
    iOS上架ipa上传问题那些事
    深入浅出iOS事件机制
    iOS如何跳到系统设置里的各种设置界面
    坑爹的私有API
    业务层网络请求封装
  • 原文地址:https://www.cnblogs.com/rohmeng/p/10992262.html
Copyright © 2011-2022 走看看