Skip to content
davidfowl edited this page Nov 5, 2011 · 27 revisions

Extensiblity

SignalR is built with DI in mind. You can replace most of SignalR pieces with your own implementations and even replace the DependencyResolver with one of your own. If you're familiar with DI in ASP.NET MVC, then it should feel similar.

Replacing individual components

You can replace individual parts of SignalR without replacing the DependencyResolver by calling DependencyResolver.Register(type, Func<object>):

DependencyResolver.Register(typeof(IMessageStore), () => new CustomMessageStore());

Replaceable components

The following lists the pluggable interfaces in SignalR.

  • IMessageStore -
  • ISignalBus -
  • IClientIdFactory -
  • IJsonStringifier -
  • IPersistentConnectionFactory -
  • IHubLocator -
  • IHubTypeResolver -
  • IHubActivator -
  • IHubFactory -
  • IJavaScriptProxyGenerator -

Replacing the DependencyResolver.

You can change the DependencyResolver to use your DI container of choice by calling DependencyResolver.SetResolver. There are already some implementations in the community:

Clone this wiki locally