Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Commit 4e1e947

Browse files
Update samples to 3.0 (#92)
1 parent 752f7c0 commit 4e1e947

File tree

35 files changed

+19944
-13033
lines changed

35 files changed

+19944
-13033
lines changed

AndroidJavaClient/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ dependencies {
2929
testImplementation 'junit:junit:4.12'
3030
androidTestImplementation 'com.android.support.test:runner:1.0.2'
3131
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
32-
implementation 'com.microsoft.signalr:signalr:1.0.0'
32+
implementation 'com.microsoft.signalr:signalr:3.0.0'
3333
implementation group: 'org.slf4j', name: 'slf4j-android', version: '1.7.7'
3434
}

AndroidJavaClient/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-bin.zip
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.1</TargetFramework>
4+
<TargetFramework>netcoreapp3.0</TargetFramework>
55
</PropertyGroup>
66

7-
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.App" />
9-
</ItemGroup>
10-
117
</Project>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
using Microsoft.AspNetCore.SignalR;
2+
using System.Threading.Tasks;
23

34
namespace ChatSample.Hubs
45
{
56
public class ChatHub : Hub
67
{
7-
public void Send(string name, string message)
8+
public async Task Send(string name, string message)
89
{
910
// Call the broadcastMessage method to update clients.
10-
Clients.All.SendAsync("broadcastMessage", name, message);
11+
await Clients.All.SendAsync("broadcastMessage", name, message);
1112
}
1213
}
1314
}

ChatSample/ChatSample/Program.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
using Microsoft.AspNetCore;
2-
using Microsoft.AspNetCore.Hosting;
1+
using Microsoft.AspNetCore.Hosting;
2+
using Microsoft.Extensions.Hosting;
33

44
namespace ChatSample
55
{
66
public class Program
77
{
88
public static void Main(string[] args)
99
{
10-
CreateWebHostBuilder(args).Build().Run();
10+
CreateHostBuilder(args).Build().Run();
1111
}
1212

13-
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
14-
WebHost.CreateDefaultBuilder(args)
15-
.UseStartup<Startup>();
13+
public static IHostBuilder CreateHostBuilder(string[] args) =>
14+
Host.CreateDefaultBuilder(args)
15+
.ConfigureWebHostDefaults(webBuilder =>
16+
{
17+
webBuilder.UseStartup<Startup>();
18+
});
1619
}
1720
}

ChatSample/ChatSample/Startup.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Microsoft.AspNetCore.Builder;
33
using Microsoft.AspNetCore.Hosting;
44
using Microsoft.Extensions.DependencyInjection;
5+
using Microsoft.Extensions.Hosting;
56

67
namespace ChatSample
78
{
@@ -15,7 +16,7 @@ public void ConfigureServices(IServiceCollection services)
1516
}
1617

1718
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
18-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
19+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
1920
{
2021
if (env.IsDevelopment())
2122
{
@@ -24,9 +25,11 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
2425

2526
app.UseFileServer();
2627

27-
app.UseSignalR(routes =>
28+
app.UseRouting();
29+
30+
app.UseEndpoints(endpoints =>
2831
{
29-
routes.MapHub<ChatHub>("/chat");
32+
endpoints.MapHub<ChatHub>("/chat");
3033
});
3134
}
3235
}

0 commit comments

Comments
 (0)