Skip to content
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

InMemory: Missing the equivalent of IRelationalDbContextOptionsBuilderInfrastructure #23669

Closed
bricelam opened this issue Dec 12, 2020 · 2 comments · Fixed by #25095
Closed
Assignees
Labels
area-in-memory closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@bricelam
Copy link
Contributor

Currently, there is no way to get from an InMemoryDbContextOptionsBuilder to the DbContextOptionsBuilder.

Our current workaround in EntityFrameworkCore.InMemrory.HierarchyId is to use reflection:

var coreOptionsBuilder = (DbContextOptionsBuilder)typeof(InMemoryDbContextOptionsBuilder)
    .GetProperty("OptionsBuilder", BindingFlags.Instance | BindingFlags.NonPublic)
    .GetValue(optionsBuilder);
@ajcvickers
Copy link
Contributor

/cc @AndriySvyryd

@AndriySvyryd
Copy link
Member

I understand now. We should make the OptionsBuilder public, but hidden from IntelliSense in InMemoryDbContextOptionsBuilder , RelationalDbContextOptionsBuilder and CosmosDbContextOptionsBuilder

@ajcvickers ajcvickers added this to the 6.0.0 milestone Dec 18, 2020
@bricelam bricelam added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed poachable labels Jun 14, 2021
bricelam added a commit to bricelam/efcore that referenced this issue Jun 14, 2021
This is the moral equivalent of IRelationalDbContextOptionsBuilderInfrastructure which lets extension methods access the core options builder.

Fixes dotnet#23669
@AndriySvyryd AndriySvyryd modified the milestones: 6.0.0, 6.0.0-preview6 Jul 2, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0-preview6, 6.0.0 Nov 8, 2021
bricelam added a commit to efcore/EFCore.SqlServer.HierarchyId that referenced this issue Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-in-memory closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants