Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject dependency rather than using new #69

Open
radu-matei opened this issue May 28, 2018 · 0 comments
Open

Inject dependency rather than using new #69

radu-matei opened this issue May 28, 2018 · 0 comments

Comments

@radu-matei
Copy link
Owner

https://github.com/radu-matei/websocket-manager/blob/master/samples/ChatApplication/ChatHandler.cs#L11

In one sample, a dependency needed for the handler is newed-up rather than injected using dependency injection. This should not be handled by the user of the library, but rather by the library itself:

        public ChatHandler(WebSocketConnectionManager webSocketConnectionManager) : base(webSocketConnectionManager, new ControllerMethodInvocationStrategy())
        {
            ((ControllerMethodInvocationStrategy)MethodInvocationStrategy).Controller = this;
        }

cc @Henry00IS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant