还有另一种方法来声明要注入(inject)的记录器的ProductController吗?

public class ProductController : Controller
{
    private readonly LoggingInterface.ILogger<ProductController> _logger;
    private readonly IProductRepository _productRepository;

    public ProductController(LoggingInterface.ILogger<ProductController> logger, IProductRepository productRepository)
    {
        _logger = logger;
        _productRepository = productRepository;
    }
{

谢谢,
史提芬

最佳答案

推理需要使用开放的泛型。此样本中没有

10-06 05:53