Skip to content

An extension to the LightInject service container that enables dependency injection for SignalR applications.

Notifications You must be signed in to change notification settings

seesharper/LightInject.SignalR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SignalR

LightInject.Signal provides an integration that enables dependency injection in SignalR hub implementations.

Installing

LightInject.SignalR provides two distribution models via NuGet

Binary

PM> Install-Package LightInject.SignalR

This adds a reference to the LightInject.SignalR.dll in the target project.

Source

PM> Install-Package LightInject.SignalR.Source

This will install a single file (LightInject.SignalR.cs) into the current project.

Initializing

The following example shows how to enable support for SignalR in an OWIN startup class.

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        var serviceContainer = new ServiceContainer();
		serviceContainer.RegisterHubs();            
	 	..register other services
		                                                                                                
        app.MapSignalR(serviceContainer.EnableSignalR());
    }
}

Services

Services that implements IDisposable must be registered with the with the PerScopeLifetime or the PerRequestLifetime to ensure that they are properly disposed when the Hub is disposed.

About

An extension to the LightInject service container that enables dependency injection for SignalR applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages