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

AccountController set up guide #37

Closed
superbmilkyway opened this issue May 7, 2015 · 5 comments
Closed

AccountController set up guide #37

superbmilkyway opened this issue May 7, 2015 · 5 comments
Labels

Comments

@superbmilkyway
Copy link

Hello,

I am quite new about IoC and simpleInjector.

I am following the document and I just installed SimpleInjector.Integration.WebApi.WebHost.QuickStart package.(vs2013, asp.net mvc5, web api.2.2, individual identification)

I cannot get over the AccountController injection.

Could I get a step by step guide to set up AccountController using SimpleInjector?
I google it heaps but really hard to find a guide.

Sincerely,

@dotnetjunkie
Copy link
Collaborator

The default ASP.NET template that gets pre-installed with VS2012 and VS2013 are about the worst templates you can imagine. It lures developers into a ton of bad practices.

The easiest way to get your application working is to remove the overloaded constructor of the AccountController and the ManageController class.

You can find a more detailed discussion about this here.

@superbmilkyway
Copy link
Author

@dotnetjunkie Thank you so much (x1000). The link is really really helpful.
Could I ask little bit more?
You said VS2012 & VS2013 Authentication template is terrible.

How about VS2015RC template?
Could you recommend any authentication source which has a good structure I can study?

@dotnetjunkie
Copy link
Collaborator

Unfortunately I'm not familiar with the VS2015RC template, so I can't feedback on that. Neither can I point at any authentication source for you. I would say that you should stick to the good practices. I would say this basically means: stick to the SOLID principles (which is hard enough to do). A good book that teaches the SOLID principles is Robert Martin's Agile Principles and Patterns and after that, you should read Mark Seemann's Dependency Injection in .NET. You might also find some articles of myself interesting, such as this one and this one.

@superbmilkyway
Copy link
Author

@dotnetjunkie Words can't describe how thankful I am 👍

@dotnetjunkie
Copy link
Collaborator

When using ASP.NET vNext with Visual Studio 2015, also take a look at this thread about integrating Simple Injector with vNext.

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

No branches or pull requests

2 participants