using Masa.Blazor.Pro.Global; using Masa.Blazor.Pro.Global.Nav.Model; using System.Reflection; namespace Microsoft.Extensions.DependencyInjection { public static class ServiceCollectionExtensions { public static IServiceCollection AddGlobalForServer(this IServiceCollection services) { //services.AddMasaI18nForServer("wwwroot/i18n"); var basePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new Exception("Get the assembly root directory exception!"); services.AddNav(Path.Combine(basePath, $"wwwroot/nav/nav.json")); //services.AddScoped(); return services; } } }