//Join chat room public void JoinRoom(int eventId) { using (var db = new Ws_DataContext()) { var item = db.Connection.OrderByDescending(x => x.ConnectionString.Equals(Context.ConnectionId)).FirstOrDefault(); if (item != null) { var userdetails = new PublicRoom() { EventId = eventId, ConnectionId = item.ConnectionId }; db.PublicRooms.Add(userdetails); db.SaveChanges(); } } }
public async Task <string> CreateRoom(PublicRoom room) { await _mongoDbContext.PublicRooms.InsertOneAsync(room); return(room.ID); }
public static PublicRoom GetInstance() { if (null == _instance) _instance = new PublicRoom(); return _instance; }