Created
May 31, 2021 15:04
-
-
Save ssukhpinder/da667168bdc1f77333a201c87abd6b78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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