I am a novice programmer, learning as I work on my first code project. I started with MVC 4 and managed to get CRUD working for a single entity. I decided to try to tackle security next. When Visual Studio scaffolded my MVC 4 project, it added an account model, views, and controller. I have since upgraded my project to MVC 5 and EF 6 using the procedure described here. I now want to replace the MVC 4 security code with MVC 5 scaffolded Identity model, view, controller. Is this possible? If so, how?
-
If you have no people actually using your site, I would just create a new MVC 5 project and copy over the new AccountController stuff.vidalsasoon– vidalsasoon2013-11-13 18:00:51 +00:00Commented Nov 13, 2013 at 18:00
-
I agree with @Jim Hill. However, you could try this stackoverflow.com/a/19940600/1210574 but even then I am not sure if Identity is compatible with MVC 4.stink– stink2013-11-13 19:41:17 +00:00Commented Nov 13, 2013 at 19:41
-
I agree with @vidalsasoon - if you are just starting to learn, you do not want to learn by making a new framework work with an old framework - you will hate it. Instead bring your single entity over to your MVC 5 project and go from there. I thought about answering this post but I just don't have the time to do all the research and work it will require.Jack– Jack2013-11-16 03:01:43 +00:00Commented Nov 16, 2013 at 3:01
1 Answer
Ironically, I was just dealing with this issue a few nights ago...
I would suggest just going to an entirely new MVC 5 application. That being said, I'm not sure how far your application is in development.
What are you using for security right now? I'm going to assume SimpleMembership? If you did, there's a really nice article/project by @Kevin Junghans that involves decoupling simplemembership from your application.
You could theoretically, using that, get away with decoupling simplemembership, then using the answer found here add in identity.
My experience led me to redo-ing it, but again, I'm not sure how far you are in development, so I don't know if that is a viable option or not. If it is, I would just suggest that, and adding in your controllers as you go.