How to suppress ambient transaction warning with EF7 RC2?
The SuppressAmbientTransactionWarning() method cannot be found.
While the question was related to RC2, as of Oct 16, 2016, this worked for me and hopefully it is useful to someone else:
services.AddDbContext<OpenDataContext>(options =>
{
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"));
options.ConfigureWarnings(x => x.Ignore(RelationalEventId.AmbientTransactionWarning));
});
Used above in an integration test setup class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With