2

Is it me or using an Ioc container with the latest Identity membership system for .Net is a mess! I've been trying to follow the example project created here using Unity

https://github.com/trailmax/IoCIdentitySample

but it is quite difficult to follow and is structured fairly differently to the bootstrap installer.

Does anyone have any better sources of info as Google is just not giving me what I need. I've heard the next CTP has DI built in, but not sure if it is against Identity or not.

Cheers

Raj
  • 897
  • 1
  • 15
  • 28
  • What are the problems you experiencing? and what bootstrap installer do you refer to? Did you follow the article linked to the repository? – trailmax Oct 22 '14 at 21:44
  • using the unity bootstrap nuget package. I followed as much as I could from your tutorial but seemed to get lost around when you edit the controllers for stuff like the token generation etc. Im a bit of a newbie at Identity (more familiar with the old Membership system) so its probably a lack of understanding on my side too. Just surprised how much effort is involved to get this running as required! – Raj Oct 22 '14 at 22:05
  • If you understand DI, not much effort is required. But if you don't need DI, Identity is running out of the box with no problems at all. I have created a site from template and had it deployed to Azure in 15 minutes and was registering/logging in there. If you don't need DI, don't change it! – trailmax Oct 22 '14 at 22:46
  • Ah, token generation. They are no fun. Give me some time, I'll update the text with easier approach. – trailmax Oct 22 '14 at 22:56
  • Right. I've updated the article, simplified some of the bits and explained a bit more about about `ApplicationUserManager` class. Changes start from header "ApplicationUserManager class". If you have more trouble, let me know in comments in my blog, I'll probably will be able to help. – trailmax Oct 22 '14 at 23:40
  • ah thanks dude, will check that out and try again. Definitely need DI as I am building quite a large app but just want the initial structure to be spot on! – Raj Oct 23 '14 at 08:54

1 Answers1

1

I had the same problem, using Ninject as IOC with Identity and Owin, but finally figured out, you can see the step by step solution here : How to inject User Manager to Account Controller with default Identity Model in Identity 2 using Ninject

Community
  • 1
  • 1
Mona Moravej
  • 141
  • 7