//依赖注入 public HomeController(IBannerServices bannerServices, INewsServices newsServices, INewsClassifyServices newsClassifyServices, INewsCommentServices newsCommentServices) { this.bannerServices = bannerServices; this.newsServices = newsServices; this.newsClassifyServices = newsClassifyServices; this.newsCommentServices = newsCommentServices; }
public NewsController(INewsServices newsServices, INewsClassifyServices newsClassifyServices, IHostingEnvironment host) { this.newsServices = newsServices; this.newsClassifyServices = newsClassifyServices; this.host = host; }
//依赖注入 public NewsController(INewsServices newsServices, INewsCommentServices newsCommentServices, INewsClassifyServices newsClassifyServices) { this.newsServices = newsServices; this.newsCommentServices = newsCommentServices; this.newsClassifyServices = newsClassifyServices; }