Skip to content

InMemory: Missing the equivalent of IRelationalDbContextOptionsBuilderInfrastructure #23669

Description

@bricelam

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);

Activity

  1. ajcvickers commented on Dec 15, 2020

    @ajcvickers
    Contributor
  2. AndriySvyryd commented on Dec 15, 2020

    @AndriySvyryd
    Member

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

  3. added this to the 6.0.0 milestone on Dec 18, 2020
  4. added 2 commits that reference this issue on Jun 14, 2021
    255cfd0
    b5915fb
  5. modified the milestones: 6.0.0, on Jul 2, 2021
  6. modified the milestones: , 6.0.0 on Nov 8, 2021
  7. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions