MVC Entity Framework with Identity Best Practise

Hi All

I'm after some help, advice and ideas for 'best practise' when using the Identity plugin for Entity Framework and code first.

I would like to keep my Entity, Repository and MVC Site in seperate solutions. But an unsure how to link them in the most efficient way. Also, on this project I m looking at integrating the Identity plugin. Now should I install and run this from the mvc site project? or the db project? or both?

Basically, I want to be able to build the t4 pages with CRUD options quickly using the scaffolding built in. However, all the videos and tutorials seem to do this with the entity framework in the same solution.

Any advice and help on this is appreciated.

Thanks in advance,

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
I haven't seen anything about a "better practice" with Identity and Entity Framework.

How much have you done with setting this up?  What is the reason that you want separate assemblies?
flynnyAuthor Commented:
Hi Bob,

I want to keep the db project seperate so multiple projects can conected through the sam entity.

Regarding using Identity, I haven't really used it before and normally scaffold up a user table, etc, so this appears in the entity project itself. Also I like to keep my projects modular as far as I can.

From looking at the MVA videos tutorials, etc. It seems that the easiest way to go about is to do the following;

1. Create a new project with authentication
2. Set the default connection to be that of the database
3. Run the project and simply create a new use by clicking the register button. This seems to then create the tables in question.

I could then just reverse engineer the entity classes from the existing entity project. So I suppose then the Identt reference would be in the MVC site project? However as there are models etc it feels like these should be extracted to a seperate DAL project maybe?

Any advice on how you implement is welcome.
Bob LearnedCommented:
I have used Identity in only one project, but it is something that I find interesting to learn.  The project that I created was an MVC 5 web site, with OWIN and Entity Framework.  The system allowed for people to use social logins, like Facebook and Twitter.

I found a nice explanation here:

Code! MVC 5 App with Facebook, Twitter, LinkedIn and Google OAuth2 Sign-on (C#)

I kept all the parts in the same assembly, as it is easier to maintain, in  my opinion.  Maintaining shared assemblies across multiple projects creates dependencies that can "muddy the waters".

I will continue to find a "better practice" reference.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.