ant-design-blazor/site/AntDesign.Docs.Wasm/Program.cs

33 lines
1.1 KiB
C#
Raw Normal View History

2020-04-24 10:34:54 +08:00
using System;
2022-11-16 17:23:29 +08:00
using System.Globalization;
2020-04-24 10:34:54 +08:00
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Web;
2020-03-11 18:45:37 +08:00
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
2019-12-04 16:46:08 +08:00
namespace AntDesign.Docs.Wasm
2019-12-04 16:46:08 +08:00
{
public class Program
{
public static async Task Main(string[] args)
2019-12-04 16:46:08 +08:00
{
2022-11-16 17:23:29 +08:00
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);
2020-03-11 18:45:37 +08:00
builder.RootComponents.Add<App>("app");
builder.RootComponents.Add<HeadOutlet>("head::after");
2020-04-24 10:34:54 +08:00
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddAntDesignDocs();
2019-12-04 16:46:08 +08:00
await builder.Build().RunAsync();
}
2019-12-04 16:46:08 +08:00
}
2020-04-24 10:34:54 +08:00
}