Skip to content

Configure HierarchyId in modular solution #20814

Closed Answered by LeanDualBoot
LeanDualBoot asked this question in Q&A
Discussion options

You must be logged in to vote

Fixed.

HierarchyId must be configured in ProyectContexFactory

public RestorNetDbContext CreateDbContext(string[] args)
{
    RestorNetEfCoreEntityExtensionMappings.Configure();

    var configuration = BuildConfiguration();

    var builder = new DbContextOptionsBuilder<RestorNetDbContext>()
        .UseSqlServer(configuration.GetConnectionString("Default"),r => r.UseHierarchyId());
    });

    return new RestorNetDbContext(builder.Options);
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LeanDualBoot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant