Guest User

Untitled

a guest
Jan 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public class SimpleServiceWithoutOCP
  2. {
  3. public void DoSomeWork()
  4. {
  5. var stuff = CallTheRepositoryForSomeStuff();
  6.  
  7. foreach(var thing in stuff)
  8. DoSomething(thing);
  9. }
  10.  
  11. private IList<Stuff> CallTheRepositoryForSomeStuff()
  12. {
  13. return Repository.GetStuff();
  14. }
  15.  
  16. private void DoSomething(Stuff stuff)
  17. {
  18. //doesn't matter what's here
  19. }
  20. }
Add Comment
Please, Sign In to add comment