Mapping Generic Hub

Viewed 24

I want to register a Hub that has an interface, but I cannot map IHub<T> to IHub

app.MapHub<LairageHub>(HubConstants.LairageHub);

code for class:

public sealed class LairageHub : Hub<ILairageHub> {}

Error:

Severity Code Description Project File Line Suppression State Error CS0311 The type 'Marel.Lairage.Innova.Models.SignalR.Hubs.LairageHub' cannot be used as type parameter 'THub' in the generic type or method 'HubEndpointRouteBuilderExtensions.MapHub(IEndpointRouteBuilder, string)'. There is no implicit reference conversion from 'Marel.Lairage.Innova.Models.SignalR.Hubs.LairageHub' to 'Microsoft.AspNetCore.SignalR.Hub'. Marel.Lairage.Innova.UI.Blazor C:\Users\cornelis.dejager\source\repos\Marel.Lairage2\Marel.Lairage2.UI.Blazor\Program.cs 62 Active

0 Answers
Related