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.

1.3 KB
Raw Blame
using Grand.Business.Core.Interfaces.Messages;
using Grand.Business.Messages.Services;
using Grand.Infrastructure;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Grand.Business.Messages.Startup;

public class StartupApplication : IStartupApplication
{
    public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
    {
        services.AddScoped<IMessageTemplateService, MessageTemplateService>();
        services.AddScoped<IQueuedEmailService, QueuedEmailService>();
        services.AddScoped<IEmailAccountService, EmailAccountService>();
        services.AddScoped<IMessageProviderService, MessageProviderService>();
        services.AddScoped<IMessageTokenProvider, MessageTokenProvider>();
        services.AddScoped<IEmailSender, EmailSender>();
        services.AddScoped<IMimeMappingService, MimeMappingService>(_ =>
        {
            var provider = new FileExtensionContentTypeProvider();
            return new MimeMappingService(provider);
        });
    }

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

    public int Priority => 100;

    public bool BeforeConfigure => false;
}