-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw exception if same hub has same
RoutePattern
.
- Loading branch information
Showing
6 changed files
with
145 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 22 additions & 2 deletions
24
...bp.AspNetCore.SignalR.Tests/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRTestModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,34 @@ | ||
using Volo.Abp.Autofac; | ||
using System; | ||
using Microsoft.AspNetCore.Builder; | ||
using Volo.Abp.AspNetCore.TestBase; | ||
using Volo.Abp.Autofac; | ||
using Volo.Abp.Modularity; | ||
|
||
namespace Volo.Abp.AspNetCore.SignalR; | ||
|
||
[DependsOn( | ||
typeof(AbpAspNetCoreSignalRModule), | ||
typeof(AbpTestBaseModule), | ||
typeof(AbpAspNetCoreTestBaseModule), | ||
typeof(AbpAutofacModule) | ||
)] | ||
public class AbpAspNetCoreSignalRTestModule : AbpModule | ||
{ | ||
public static Exception UseConfiguredEndpointsException { get; set; } | ||
|
||
public override void OnApplicationInitialization(ApplicationInitializationContext context) | ||
{ | ||
var app = context.GetApplicationBuilder(); | ||
|
||
app.UseRouting(); | ||
|
||
UseConfiguredEndpointsException = null; | ||
try | ||
{ | ||
app.UseConfiguredEndpoints(); | ||
} | ||
catch (Exception e) | ||
{ | ||
UseConfiguredEndpointsException = e; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
framework/test/Volo.Abp.AspNetCore.SignalR.Tests/Volo/Abp/AspNetCore/SignalR/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Volo.Abp.AspNetCore.SignalR; | ||
using Volo.Abp.AspNetCore.TestBase; | ||
|
||
var builder = WebApplication.CreateBuilder(); | ||
await builder.RunAbpModuleAsync<AbpAspNetCoreSignalRTestModule>(); | ||
|
||
public partial class Program | ||
{ | ||
} |
37 changes: 37 additions & 0 deletions
37
...olo.Abp.AspNetCore.SignalR.Tests/Volo/Abp/AspNetCore/SignalR/SampleHubs/RegularHubBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Microsoft.AspNetCore.SignalR; | ||
using Volo.Abp.DependencyInjection; | ||
|
||
namespace Volo.Abp.AspNetCore.SignalR.SampleHubs; | ||
|
||
public abstract class RegularHubBase<THub> : Hub<THub> where THub : class | ||
{ | ||
|
||
} | ||
|
||
[DisableConventionalRegistration] | ||
[ExposeServices(typeof(RegularHubClass1))] | ||
public class RegularHubClass1 : RegularHubBase<RegularHubClass1> | ||
{ | ||
|
||
} | ||
|
||
[DisableConventionalRegistration] | ||
[ExposeServices(typeof(RegularHubClass12), typeof(RegularHubClass1))] | ||
public class RegularHubClass12 : RegularHubClass1 | ||
{ | ||
|
||
} | ||
|
||
[DisableConventionalRegistration] | ||
[ExposeServices(typeof(RegularHubClass2))] | ||
public class RegularHubClass2 : RegularHubBase<RegularHubClass2> | ||
{ | ||
|
||
} | ||
|
||
[DisableConventionalRegistration] | ||
[ExposeServices(typeof(RegularHubClass22), typeof(RegularHubClass2))] | ||
public class RegularHubClass22 : RegularHubClass2 | ||
{ | ||
|
||
} |