ant-design-blazor/site/AntDesign.Docs.Wasm/Program.cs
2022-11-16 17:44:09 +08:00

33 lines
1.1 KiB
C#

using System;
using System.Globalization;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace AntDesign.Docs.Wasm
{
public class Program
{
public static async Task Main(string[] args)
{
if (!CultureInfo.CurrentCulture.Name.IsIn("en-US", "zh-CN"))
{
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
}
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddAntDesignDocs();
await builder.Build().RunAsync();
}
}
}