websocket-manager icon indicating copy to clipboard operation
websocket-manager copied to clipboard

Cannot inject dependencies in the sockethandler or use servicelocator to do so

Open danielohirsch opened this issue 6 years ago • 1 comments

Since the middleware is scoped differently in the service registration - it won't allow something to either be injected (obviously) or created inside that scope that is not scoped the same. For instance, I have a manager that I am using a special factory to instantiate - inside a method on the WebSocketHandler...

I tried scoping my factory in different ways - but because the handler (acting as the controller) is scoped differently then my manager... it won't allow it - in dotnetcore 2+

I don't see a nice way around this... because to do method injection on the invoke method would require me to either override and recode the invoke method or do something else wonky to get the classes that I need... any advice would be appreciated.

danielohirsch avatar May 31 '18 15:05 danielohirsch

Same problem right here

egops avatar Aug 29 '18 00:08 egops