Skip to content

Instantly share code, notes, and snippets.

@ssukhpinder
Created June 5, 2021 10:39
Show Gist options
  • Save ssukhpinder/8062ccced346d18798ce61ec6e02ad85 to your computer and use it in GitHub Desktop.
Save ssukhpinder/8062ccced346d18798ce61ec6e02ad85 to your computer and use it in GitHub Desktop.
public class User
{
private Chatroom _chatroom;
private string _name;
public User(string name) => this._name = name;
public string Name => _name;
public Chatroom Chatroom
{
set { _chatroom = value; }
get => _chatroom;
}
public void Post(string to, string message) =>
_chatroom.Post(_name, to, message);
public virtual void DM(string from, string message) =>
Console.WriteLine("{0} to {1}: '{2}'", from, Name, message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment