user3021864
user3021864

Reputation: 11

MVC 5.0 Appnet Identity mixing Code First and Database First

I'm creating a new Web Application based on MVC 5. I have Database and would like to Use Database First workflow. I would like to Use Aspnet Identity new features, but they rely on Code First. Will it be possible to mix, so that i manage Authentication and Authorization with the new Aspnet Identity, and Database First for all the Business Logic Application?

Thanks

Upvotes: 1

Views: 322

Answers (2)

Kaleet
Kaleet

Reputation: 91

I'm trying to learn MVC and it is quickly pissing me off.

The way I solved this problem is to:

  1. In your main model, add you ADO.NET Entity Data Model
  2. In your web.config, change the defaultconnection to the database in MS-SQL.
  3. Enable-Migrations on your ApplicationDbContext

Yes, this means there are two connections to the database. I would love to hear on what is a better way.

Upvotes: 0

MarvinDeLaCruz
MarvinDeLaCruz

Reputation: 51

I think mixing things isn't the best way. code first and data first they have a reason to be different, might be the best way to solve this is to use a database for the authentication process and another database for the busines logic, hope it helps you

Upvotes: 1

Related Questions