public void UpdateActivity(string user) { Chatter activity = currentUsers.FirstOrDefault(u => u.Name == user); if (activity != null) { activity.LastActivity = DateTime.Now; } }
public void Add(string user) { if (currentUsers.All(u => u.Name != user)) { Chatter activity = new Chatter { Name = user }; currentUsers.Add(activity); } }
public void Remove(string user) { Chatter activity = currentUsers.FirstOrDefault(u => u.Name == user); currentUsers.Remove(activity); }