Does ASP.NET Core's DI container assures order of services?

后端 未结 2 516
名媛妹妹
名媛妹妹 2021-01-16 13:05

When I register multiple services to the DI container with the same interface and then request an IEnumerable, do the container guarantee that t

2条回答
  •  失恋的感觉
    2021-01-16 13:39

    Yes they execute in order, read more: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-3.1

    EDIT: More specific link: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/startup?view=aspnetcore-3.1#extend-startup-with-startup-filters

    Thanks to @Sai Puli

提交回复
热议问题