服务

A service is a component that is intended for common consumption in an application. Services are made available through dependency injection. ASP.NET Core includes a simple built-in inversion of control (IoC) container that supports constructor injection by default, but can be easily replaced with your IoC container of choice. In addition to its loose coupling benefit, DI makes services available throughout your app. For example, Logging is available throughout your app. See Dependency Injection for more details.

服务是用于在应用程序做公共调用的组件。 服务是通过依赖注入提供。 ASP.NET Core 包含了一个简单的内建的控制反转(IoC)容器来默认为构造函数提供注入,但是也可以使用你自己的IoC容器来代替它。 除了其松耦合的好处,依赖注入使得服务在你的应用中始终可用。 例如,在你的应用中,Logging 服务是始终可用的。 查看 依赖注入 获取更多详细信息。

results matching ""

    No results matching ""