Created
May 12, 2019 14:13
-
-
Save kasunkv/1dd9a95a7f98c55ca3147165e7e997cf to your computer and use it in GitHub Desktop.
ASP.Net Core Dependency Injection - Implementation Factory
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.AddScoped<Discount>(sp => | |
{ | |
return new DiscountBuilder() | |
.WithMinimumBillAmount(1000) | |
.WithMinimumItemCount(3) | |
.WithPercentage(10) | |
.Build(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment