Skip to content

Instantly share code, notes, and snippets.

@ssukhpinder
Created May 31, 2021 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssukhpinder/da667168bdc1f77333a201c87abd6b78 to your computer and use it in GitHub Desktop.
Save ssukhpinder/da667168bdc1f77333a201c87abd6b78 to your computer and use it in GitHub Desktop.
public class Sukhpinder : ICelebrityInstagram
{
private readonly List<IFollower> _posts = new List<IFollower>();
private string _post;
public string FullName => "Sukhpinder Singh";
public string Post {
get { return _post; }
set
{
Notify(value);
}
}
public void AddFollower(IFollower follower)
{
_posts.Add(follower);
}
public void Notify(string post)
{
_post = post;
foreach (var item in _posts)
{
item.Update(this);
}
}
public void RemoveFollower(IFollower follower)
{
_posts.Remove(follower);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment