Is there a code sample on how to use multiple DbContext
Hi devart team
I am developing an ASP.Net Core application using .Net 8.0 and DevArt.Data.Oracle 10.3.10 and DevArt.Data.Oracle.EFCore 10.3.10.8.
I have two projects each has a DbContext. In the program.cs for both DbContext
services.AddDbContext<DatabaseContext>(options =>
{
options.UseOracle(connectionString);
});
is called.
This works fine, but I am not able to use one transaction for a use case where I need to do changes on both DbContext.
Do you have any code sample for this szenario?
I found the method UseOracle() with the OracleConnection parameter instead of the connection string. But I did not find a code sample, because I would need to create OracleConnection.
Can you tell me if there are code samples?
Best regards, Matthias