Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

1022 B
Raw Blame
using DiscountRules.Standard.Providers;
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Infrastructure;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace DiscountRules.Standard;

public class StartupApplication : IStartupApplication
{
    public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
    {
        services.AddScoped<IDiscountProvider, DiscountProvider>();
        services.AddScoped<CustomerGroupDiscountRule>();
        services.AddScoped<HadSpentAmountDiscountRule>();
        services.AddScoped<HasAllProductsDiscountRule>();
        services.AddScoped<HasOneProductDiscountRule>();
        services.AddScoped<ShoppingCartDiscountRule>();
    }

    public int Priority => 10;

    public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
    {
    }

    public bool BeforeConfigure => false;
}