mirror of https://github.com/abpframework/abp.git
committed by
GitHub
6 changed files with 145 additions and 6 deletions
@ -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; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace Volo.Abp.AspNetCore.SignalR; |
namespace Volo.Abp.AspNetCore.SignalR; |
||||
|
|
||||
[DependsOn( |
[DependsOn( |
||||
typeof(AbpAspNetCoreSignalRModule), |
typeof(AbpAspNetCoreSignalRModule), |
||||
typeof(AbpTestBaseModule), |
typeof(AbpAspNetCoreTestBaseModule), |
||||
typeof(AbpAutofacModule) |
typeof(AbpAutofacModule) |
||||
)] |
)] |
||||
public class AbpAspNetCoreSignalRTestModule : AbpModule |
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; |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
|
|||||
@ -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 |
||||
|
{ |
||||
|
} |
||||
@ -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 |
||||
|
{ |
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue