SanteR
SanteR

Reputation: 13

MVC 5, EntityFramework 6 CF, Identity (authorization)

I decided to add authorization by means of Identity added in MVC 5.

In the project there was one context and use EF CodeFirst -

public class PostDBContext : DbContext

I added authorization with Identity EntityFramework use, but there the context -

public class MyDbContext : IdentityDbContext<ApplicationUser>

As it will be more correct: to integrate my old context with a context used for authorization, thereby to change a class from which it is inherited and to transfer everything to one?

Or to leave two contexts?

And what change of my context with DbContext on IdentityDbContext will entail? I use one database. I checked and both options work. Whether will be then difficulties? Thanks!

Upvotes: 1

Views: 457

Answers (1)

Jelle Oosterbosch
Jelle Oosterbosch

Reputation: 1742

Why not using 1 context, I created a MVC 5 application a few weeks ago, and was wondering the same thing, but it is so easy to just use 1 context. And why not? Everything used to access it should be independent of it...

My tip, use 1 context :)..

Upvotes: 1

Related Questions