Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inherit from a generic Hub

Tags:

signalr

Assume I have a base class like this :

public class CustomizedHub<M> : Hub
{
...
}

and now I want to inherit all of practical hubs from this base class , but I get the following error :

Type CustomizedHub`1<M> is a generic type definition

The main reason for above error is SignalR tries to resolve the base class as a practical hub too. How can I enforce it to avoid this?

like image 955
Mahmoud Moravej Avatar asked Feb 12 '23 10:02

Mahmoud Moravej


1 Answers

Just make your base class as an abstract class :

 public abstract class CustomizedHub<M> : Hub
{
...
}
like image 111
Mahmoud Moravej Avatar answered Mar 04 '23 01:03

Mahmoud Moravej