we are using websocket-sharp (https://github.com/sta/websocket-sharp). In our WebSocketBehavior we would like to use services that we inject with Autofac. So far we haven't found a way to do that.
How would one use DI with websocket-sharp?
we are using websocket-sharp (https://github.com/sta/websocket-sharp). In our WebSocketBehavior we would like to use services that we inject with Autofac. So far we haven't found a way to do that.
How would one use DI with websocket-sharp?
Ok, you have to use a Func to inject things in the constructor like so:
wssv.AddWebSocketService<Chat> ("/ChatWithNyan", () => new Chat (" Nyan!"));
Taken from here: https://github.com/sta/websocket-sharp