Skip to content

Commit 7b6d473

Browse files
committed
Change to top level statements and remove Startup.cs
1 parent 0f15a10 commit 7b6d473

File tree

2 files changed

+13
-44
lines changed

2 files changed

+13
-44
lines changed

samples/Whiteboard/Program.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
using Microsoft.AspNetCore;
5-
using Microsoft.AspNetCore.Hosting;
4+
using Microsoft.AspNetCore.Builder;
5+
using Microsoft.Extensions.DependencyInjection;
6+
using Microsoft.Azure.SignalR.Samples.Whiteboard;
67

7-
namespace Microsoft.Azure.SignalR.Samples.Whiteboard;
8+
var builder = WebApplication.CreateBuilder(args);
9+
builder.Services.AddSingleton<Diagram>();
10+
builder.Services.AddMvc();
11+
builder.Services.AddSignalR().AddAzureSignalR();
812

9-
public class Program
10-
{
11-
public static void Main(string[] args)
12-
{
13-
CreateWebHostBuilder(args).Build().Run();
14-
}
13+
var app = builder.Build();
14+
app.UseRouting();
15+
app.UseFileServer();
16+
app.MapControllers();
17+
app.MapHub<DrawHub>("/draw");
1518

16-
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
17-
WebHost.CreateDefaultBuilder(args)
18-
.UseStartup<Startup>();
19-
}
19+
app.Run();

samples/Whiteboard/Startup.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)