using Lada.Framework.Data.Repositories; using Lada.Framework.Infrastructures.Services; using Lada.Framework.Infrastructures.AppSettings; using Microsoft.Extensions.Options; using ladaexpress.vn.Infrastructures.Routes; using ladaexpress.vn.Infrastructures.Services; using ladaexpress.vn.Infrastructures.Services.Seo; namespace ladaexpress.vn.Infrastructures.StartupRegisters { public static class DependencyRegister { public static void RegisterDependency(this IServiceCollection services, IConfiguration configuration) { #region AppSettings services.Configure(options => configuration.GetSection("Media").Bind(options)); #endregion #region Repositories services.AddTransient(typeof(IRepository<>), typeof(Repository<>)); #endregion services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); #region Services services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); // SEO Services services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); // AppConfig Services cho ladaexpress.vn services.AddScoped(); // S? d?ng AppConfigService t? Framework (da di chuy?n) - cho backward compatibility services.AddScoped(); // Media Services (ch? c?n IImageService d? convert SystemPath  URL) services.AddScoped(provider => { var settings = provider.GetRequiredService>(); var appConfigService = provider.GetService(); return new ImageService(settings, appConfigService); }); #endregion // Register startup tasks services.AddStartupTasks(); } } }