Created
May 7, 2019 15:50
-
-
Save kasunkv/5ac0aa15e3f3468ab1fe150a4dbbb716 to your computer and use it in GitHub Desktop.
Register multiple implementations - Method 02
This file contains hidden or 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
services.AddScoped<IDiscountProcessor, OrderDiscountProcessor>(); | |
services.TryAddEnumerable(new[] | |
{ | |
ServiceDescriptor.Scoped<IDiscount, SeasonalDiscount>(), | |
ServiceDescriptor.Scoped<IDiscount, LargeOrderDiscount>(), | |
ServiceDescriptor.Scoped<IDiscount, ThreeOrModeDiscount>() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment