如何将UserManager实例传递给名为PhysicalFileAttachmentService的服务?
这是代码
公共类PhysicalFileAttachmentService:IFileAttachmentService { 私人只读…
嗨,您必须首先注入作为构造函数的参数传递的其他服务,如下所示
services.AddLogging(configure => configure.AddConsole()) .AddTransient<iuserrepository>(sp => new UserRepository(connectionString, sp.GetService<ilogger<userrepository>>()))
在将这些服务注入到PhysicalFileAttachmentService之前,希望您能从代码中获得想法