Guest User

Untitled

a guest
Nov 21st, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public interface ISomething
  2. {
  3. void DoSomething();
  4. }
  5.  
  6. public class SomethingA : ISomething
  7. {
  8. public void DoSomething()
  9. {
  10.  
  11. }
  12. }
  13.  
  14. public class SomethingAB : ISomething
  15. {
  16. public void DoSomething()
  17. {
  18.  
  19. }
  20. }
  21.  
  22. public class Different
  23. {
  24. private ISomething ThisSomething;
  25.  
  26. public Different(ISomething Something)
  27. {
  28. ThisSomething = Something;
  29. }
  30. }
  31.  
  32. //NOTES: In some circumstances in your app you may want SomethingA to be used in class Different and sometimes SomethingAB. How do you tell the IOC when to use the relevant class?
Add Comment
Please, Sign In to add comment