Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. ICar
  2. {
  3. string Drive();
  4. }
  5.  
  6. public class BMW
  7. {
  8. public string Drive(){...};
  9. }
  10.  
  11. public class Jaguar
  12. {
  13. public string Drive(){...};
  14. }
  15.  
  16. public void ConfigureServices(IServiceCollection services)
  17. {
  18. // Add framework services.
  19. services.AddMvc();
  20. services.AddTransient<ICar, BMW>();
  21. // or
  22. services.AddTransient<ICar, Jaguar>();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement