コード例 #1
0
        public ChatHubUserMessage(
            string text,
            DateTime sentAt,
            IChatHubHistory history,
            Func <IServiceProvider> serviceProviderFactory)
            : base(text, sentAt, history)
        {
            var provider = serviceProviderFactory();

            _chatSession = provider.GetRequiredService <IChatSession>();
        }
コード例 #2
0
        public ChatHubAdministratorMessage(
            string text,
            DateTime sentAt,
            IChatHubHistory history,
            Func <IServiceProvider> serviceProviderFactory)
            : base(text, sentAt, history)
        {
            var provider = serviceProviderFactory();


            _hubContext         = provider.GetRequiredService <IHubContext <ChatHub> >();
            _userChatHubSession = provider.GetRequiredService <IUserChatHubSession>();
            _uowFactory         = provider.GetRequiredService <Func <UnitOfWork> >();
        }