public Chat(IServiceProvider provider, ILogger <Chat> logger) { _visitors = (IVisitorService)provider.GetService(typeof(IVisitorService)); _templateService = (ITemplateService)provider.GetService(typeof(ITemplateService)); _logger = logger; Users = _visitors.GetUsers(); }
public IndexModel(IHubContext <Notify> hub, IServiceProvider provider, IConfiguration configuration, ILogger <IndexModel> logger) { _hub = hub; _visitors = (IVisitorService)provider.GetService(typeof(IVisitorService)); _templateService = (ITemplateService)provider.GetService(typeof(ITemplateService)); _logger = logger; Users = _visitors.GetUsers(); }