EntityFramework.Docs icon indicating copy to clipboard operation
EntityFramework.Docs copied to clipboard

Document changing connection/connection string

Open ajcvickers opened this issue 4 years ago • 3 comments

See https://github.com/dotnet/efcore/issues/6525 https://github.com/dotnet/efcore/issues/8427 https://github.com/dotnet/efcore/issues/8494

ajcvickers avatar Jan 30 '20 21:01 ajcvickers

@ajcvickers just for a follow-up: any plans on moving forward with this?

mviegas avatar Aug 05 '21 14:08 mviegas

@mviegas Yes. But other things are are higher priority right now.

ajcvickers avatar Aug 06 '21 09:08 ajcvickers

Would really appreciate some documentation on how I can use a dbcontext pool in an ASP.NET Web API that needs to make sure correct connection string (we have 2 db users - masked and unmasked using dynamic data masking) is used for each request so connection string needs to be set each time taking user information from httpContext into account

Previous work around used in 5.0 has stopped working correctly in 6.0 (likely due to optimizations reusing existing connections as mentioned here https://devblogs.microsoft.com/dotnet/announcing-entity-framework-core-6-0-preview-4-performance-edition/#pooling-and-recycling-dbcontext-and-beyond) and rather then another work around Id like to see how to do it correctly

See https://github.com/dotnet/efcore/issues/19906 and follow issues referenced by it

slubowsky avatar Nov 17 '21 14:11 slubowsky