Skip to content

Commit 375a3da

Browse files
committed
Simplify playground app with top-level statements
1 parent 46e60b7 commit 375a3da

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
// Licensed under terms of MIT license (see LICENSE-MIT)
22
// Copyright 2021 Atif Aziz, Dinh Doan Van Bien
33

4-
namespace DocoptNet.Playground
5-
{
6-
using System;
7-
using System.Net.Http;
8-
using System.Threading.Tasks;
9-
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
10-
using Microsoft.Extensions.DependencyInjection;
4+
using System;
5+
using System.Net.Http;
6+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
7+
using Microsoft.Extensions.DependencyInjection;
118

12-
static class Program
13-
{
14-
public static async Task Main(string[] args)
15-
{
16-
var builder = WebAssemblyHostBuilder.CreateDefault(args);
17-
builder.RootComponents.Add<App>("#app");
18-
var baseUrl = new Uri(builder.HostEnvironment.BaseAddress);
19-
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = baseUrl });
20-
await builder.Build().RunAsync();
21-
}
22-
}
23-
}
9+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
10+
builder.RootComponents.Add<DocoptNet.Playground.App>("#app");
11+
var baseUrl = new Uri(builder.HostEnvironment.BaseAddress);
12+
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = baseUrl });
13+
await builder.Build().RunAsync();

0 commit comments

Comments
 (0)