简体   繁体   English

ASP.NET 核心 - 与 ConfigureServices 等效的 IStartupFilter?

[英]ASP.NET Core - IStartupFilter equivalent for ConfigureServices?

I need something to extend my middleware pipeline with new ConfigureServices methods.我需要一些东西来使用新的ConfigureServices方法扩展我的中间件管道。 I'm already using the IStartupFilter class which works great for the Configure method, but I'm looking to achieve the same for the ConfigureServices method.我已经在使用IStartupFilter class,它非常适合Configure方法,但我希望为ConfigureServices方法实现相同的效果。

I read online about the IStartupConfigureServicesFilter class, but it's deprecated and no longer in use ( source ).我在线阅读了有关IStartupConfigureServicesFilter class 的信息,但它已被弃用且不再使用( 来源)。

Is there anything else I can use to achieve this?还有什么我可以用来实现这一目标的吗?

Try this StartupModules NuGet , it gives you the ability to separate startup configuration.试试这个StartupModules NuGet ,它使您能够分离启动配置。

Be careful with middlewares, because those modules will not be ordered at runtime.小心使用中间件,因为这些模块不会在运行时排序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET 核心 IStartupFilter 实现 - ASP.NET Core IStartupFilter implementation asp.net核心Windsor与ConfigureServices - asp.net core Windsor vs ConfigureServices ASP.NET Core 中的 ConfigureServices() 和 Configure() 有什么区别? - What are the differences between ConfigureServices() and Configure() in ASP.NET Core? 在 ConfigureServices 中使用 ASP.NET Core DI 解析实例 - Resolving instances with ASP.NET Core DI from within ConfigureServices 在 ASP.NET Core 中,如何使用在 ConfigureServices() 中的 Configure() 中设置的服务? - In ASP.NET Core, how do I use a service that is setup in ConfigureServices() in Configure()? ConfigureServices方法中的ASP.NET Core 1.0访问服务(Startup.cs) - ASP.NET Core 1.0 access service in ConfigureServices method (Startup.cs) 如何获取我在Asp.Net核心的Startup.ConfigureServices中添加的所有授权策略? - How to get all Authorize Policies that I added in the Startup.ConfigureServices in Asp.Net core? 如何在 ConfigureServices 方法中使用 ASP.NET Core 2.1 读取用户环境变量? - How do you read user environment variables with ASP.NET Core 2.1 in the ConfigureServices method? 是否在Asp.Net Core中两次在ConfigureServices()中添加AddMvc()服务是一种好习惯? - Is adding AddMvc() Service twice in ConfigureServices() a good practice in Asp.Net Core? 测试通过ASP.NET Core API通过Startup.ConfigureServices()配置的Polly重试polly - Test Polly retry polly configured via Startup.ConfigureServices() with ASP.NET Core API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM