-
-
Save lgolubyev/815c2df405580fc6f4d8e6d930c60000 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 interface IEmployee | |
{ | |
void Work(); | |
} | |
public class Human : IEmployee | |
{ | |
public void Work() | |
{ | |
// ....working | |
} | |
} | |
public class Robot : IEmployee | |
{ | |
public void Work() | |
{ | |
//.... working much more | |
} | |
} | |
public class Manager | |
{ | |
private readonly IEnumerable<IEmployee> _employees; | |
public Manager(IEnumerable<IEmployee> employees) | |
{ | |
_employees = employees; | |
} | |
public void Manage() | |
{ | |
foreach (var employee in _employees) | |
{ | |
_employee.Work(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment