Skip to content

UseEntityFramework dynamic DbContext per request #691

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

You must be logged in to vote

Assuming you're using EF Core, you could do something like this;

Audit.Core.Configuration.Setup()
    .UseEntityFramework(cfg => cfg
        .UseDbContext(efEvent => efEvent.GetEntityFrameworkEvent().GetDbContext().GetService<ApplicationDbContext>()));

Replies: 1 comment

Comment options

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