在这种情况下,我有第一个案例
public class WebHostBuilder : IWebHostBuilder
{
private IConfiguration _config;
private ILoggerFactory _loggerFactory;
}
另一个是
public class WebHostBuilder : IWebHostBuilder
{
private IConfiguration _config {get; set;};
private ILoggerFactory _loggerFactory {get; set;};
}
我的问题是两者中哪一个是正确的或最常用的?