-
Notifications
You must be signed in to change notification settings - Fork 97
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
Bug: Duplicated tables #10
Comments
Thanks so much for spotting this. Maybe an overload for AddCoreAdmin() that takes a type of DbContext to constrain it could work? |
Yeah, this would definitely work, but a way to support not adding multiple dbContexts by default, would be nice. Do you mind me making a PR for this, when i have the time? |
Absolutely I accept PRs! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I set this admin panel up with a DbContext that extends
ApiAuthorizationDbContext<ApplicationUser>
to authenticate with IdentityServer, I get duplicated DbSets.Is there a way to ensure it does not list DbSet's if they are already listed? Or filter DbSets, to only show e.g.
Users
andRoles
as well as my custom DbSets such asEcosystems
.EDIT:
I think the duplicated
DbSet
s are caused by this code when a user inherits from a subtype ofDbContext
:I suspect the services collection contains multiple references to the implemented
DbContext
so it can be resolved from all its inherited interfaces. As such, I believe aDiscoveredDbContext
is added for each found subtype ofDbContext
even though they reference the same implementedDbContext
. Maybe a check can be made to check whether aDbContext
has already been processed, and in that case, it can be skipped, so theDbSet
s are no longer duplicated.I hope this helps! :-)
The text was updated successfully, but these errors were encountered: