如何访问 .NET Core 中的数据库上下文表单视图以创建自定义 HTML 帮助程序扩展?
使用@inject 关键字。 @inject StatisticsService StatsService
https://learn.microsoft.com/en-us/aspnet/core/mvc/views/dependency-injection?view=aspnetcore-2.2