Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ICar
- {
- string Drive();
- }
- public class BMW
- {
- public string Drive(){...};
- }
- public class Jaguar
- {
- public string Drive(){...};
- }
- public void ConfigureServices(IServiceCollection services)
- {
- // Add framework services.
- services.AddMvc();
- services.AddTransient<ICar, BMW>();
- // or
- services.AddTransient<ICar, Jaguar>();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement