using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using zero.Web.Sections; using zero.Web.ViewHelpers; namespace zero.Web.Defaults { internal class ZeroBackofficePlugin : ZeroPlugin { public ZeroBackofficePlugin() { Options.Name = "zero.Defaults"; Options.LocalizationPaths.Add("~/Resources/Localization/zero.{lang}.json"); } public override void Configure(IZeroOptions zero) { zero.Sections.Add(); zero.Sections.Add(); zero.Sections.Add(); zero.Sections.Add(); zero.Sections.Add(); zero.Settings.AddGroup(); zero.Settings.AddGroup(); zero.Permissions.AddCollection(); zero.Permissions.AddCollection(); zero.Permissions.AddCollection(); zero.Permissions.AddCollection(); zero.Icons.AddSet("feather", "Feather", "/assets/icons/feather.svg", "fth"); zero.Pages.Add(Constants.Pages.FolderAlias, "@page.folder.name", "@page.folder.description", "fth-folder"); zero.Interceptors.Add(gravity: 100); zero.Interceptors.Add(gravity: -1); zero.Interceptors.Add(gravity: -1); } public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { //services.AddAll(typeof(IValidator<>), ServiceLifetime.Scoped); //services.AddAll(typeof(IValidator), ServiceLifetime.Scoped); 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(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddScoped(); services.AddTransient(); services.AddTransient(); services.AddScoped(); services.AddScoped(typeof(ICollectionContext<>), typeof(CollectionContext<>)); services.AddScoped(typeof(IInterceptorRunner<>), typeof(InterceptorRunner<>)); services.AddScoped(); } } }