Identity user link in another context

I am new to Entity Framework and working on a project that uses Entity Framework 6, Identity 2, Web Api 2, and MVC 5.

In the initial workings of the project, I created a BusinessConnectionsContext to represent the assembly of my business models. I left ApplicationDbContext, which is automatically created on my devices, so far. I mainly focus on Web Api 2.

In my solution, I have an assembly for my models that includes BusinessConnectionsContext and ApplicationDbContext, an assembly for Web Api, and an assembly for the Web using MVC5. WebApi and Web sites will use model assembly.

I came to the point where I need to associate ApplicationDbContext users with BusinessConnectionsContext, but I can not find any information about this. I have a feeling that I may be wrong.

Should all models in BusinessConnectionsContext move to ApplicationDbContext?

This seems to be a pretty hefty move. What usually happens if you had other unrelated contexts that require references to a person in the same system?

+4
source share
1 answer

- . ApplicationDbContext, , . , Identity, , , .

, , , ? . , , , .


, , ApplicationUserManager, IUserStore.

, , - , , ( , webapi), ApplicationUserManager. - Unity, , . , IOwinContext, ApplicationUserManager. , ( , ), , , , - .

+1

All Articles