You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Startup
{
public void Configuration(IAppBuilder app)
{
var container = new Container();
container.Options.DefaultScopedLifestyle = new ExecutionContextScopeLifestyle();
container.Register<DbContext, MyDbContext>(Lifestyle.Scoped);
container.Register<ISampleRepository, SampleRepository>(Lifestyle.Scoped);
// if you want to use the same container in WebApi don't forget to add
app.Use(async (context, next) => {
using (container.BeginExecutionContextScope())
await next();
});
// ... configure web api
var config = new HubConfiguration
{
Resolver = new SimpleInjectorSignalRDependencyResolver(container)
}
// ... configure the rest of SignalR
// important to pass SimpleInjectorHubDispatcher
app.MapSignalR<SimpleInjectorHubDispatcher>("/signalr", config);
}
}
P.S. I tried to make a PR but experienced problems with the project solution in my dev environment.
The text was updated successfully, but these errors were encountered:
Could you add an integration package for SignalR using the following source code?
file SimpleInjectorSignalRDependencyResolver.cs
file SimpleInjectorHubDispatcher.cs
Registration sample:
P.S. I tried to make a PR but experienced problems with the project solution in my dev environment.
The text was updated successfully, but these errors were encountered: