Skip to content

How to use Multiple DbContexts ? #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
houssam-saissi opened this issue Oct 24, 2018 · 4 comments
Closed

How to use Multiple DbContexts ? #100

houssam-saissi opened this issue Oct 24, 2018 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@houssam-saissi
Copy link

Hi @skoruba ,

How to use Multiple DbContexts with multiple Databases ? I want to use :

  • 1 database for Clients, ApiScopes, ApiResources, PersistedGrants ...
  • 1 database for Users, Roles, UserClaims ...

I have created a new DbContext (AuthDbContext) but i'm confused how to get it work :/

Any idea ? ^_^

@skoruba skoruba self-assigned this Oct 25, 2018
@skoruba skoruba added the question Further information is requested label Oct 25, 2018
@skoruba
Copy link
Owner

skoruba commented Oct 25, 2018

Hi @houssam-saissi
Great question, I will try this use case and I will send some example for you.

Thanks!

@skoruba
Copy link
Owner

skoruba commented Nov 6, 2018

Hi @houssam-saissi,

Sorry for the delay. Currently you need to consider if you want to show the userName and some other information about user in view c
alled PersistedGrants, because this view is bound with Asp.Net Core Identity. Or you can use Services/Repositories of PersistedGrants without relationship to Asp.Net Core Identity and show for example only SubjectId which is part of PersistedGrant table.
Please let me know.
Thanks.
Jan

@DaveFUK
Copy link

DaveFUK commented Dec 5, 2018

I'm very interested in this solution since I've got the same architecture.
My AspNetIdentity is using one database and the IdentityServer configuration is held in a second database.
This seems like a sensible way of architecting the application and would have thought many more people would be using it. I'm finding this impossible to get working.

I don't think I'm too bothered about having the user information in the PersistedGrants view.

@skoruba skoruba mentioned this issue Apr 4, 2019
@skoruba
Copy link
Owner

skoruba commented Apr 4, 2019

Done on master. Please check new release.
Thanks!

@skoruba skoruba closed this as completed Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants