public ChatRoomHub(IChatRoomDatabaseSettings settings)
        {
            var client = new MongoClient(settings.ConnectionString);

            var database = client.GetDatabase(settings.DatabaseName);

            _chatroom = database.GetCollection <ChatRoom>(settings.ChatRoomsCollectionName);
        }
Пример #2
0
        public TopicsService(ApplicationDbContext context,
                             IChatRoomDatabaseSettings settings)
        {
            _context = context;

            var client = new MongoClient(settings.ConnectionString);

            var database = client.GetDatabase(settings.DatabaseName);

            _chatroom = database.GetCollection <ChatRoom>(settings.ChatRoomsCollectionName);
        }
        public ChatroomService(ApplicationDbContext context,
                               IHubContext <ChatRoomHub> hubContext,
                               IChatRoomDatabaseSettings settings,
                               UserManager <AppUser> userManager)
        {
            _context = context;

            _hubContext = hubContext;

            var client = new MongoClient(settings.ConnectionString);

            var database = client.GetDatabase(settings.DatabaseName);

            _chatroom = database.GetCollection <ChatRoom>(settings.ChatRoomsCollectionName);

            _userManager = userManager;
        }