« Entity Framework Core: Changing Database Schema at Runtime | Main | Entity Framework Core: Changing DB Migration Schema at Runtime »

06/06/2018

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Saeid

You don't need `ConfigureAwait(false)` in .NET Core apps.
https://blog.stephencleary.com/2017/03/aspnetcore-synchronization-context.html

Pawel

@Saeid: What we have here is just sample code. Usually the database accesses are implemented in a class library targeting .NET Standard (2.0). If that's the case and the library is being used in WPF (.NET 4.x) then the application is going to end in a deadlock.
I am putting ConfigureAwait(false) into demos as well because my Rider and ReSharper is configured that way :)

Delbert Matlock

You have a serious bug exposed if you are running the async example under EF Core 2.2. You must create your DbContext inside of the TransactionScope block, otherwise, connections will not be released back to the connection pool. Had serious issue with an application that would freezer up after some time due to connection pool exhaustion. Once a using statement for creating the DbContext was put inside of the using statement for the TransactionScope, the issue went away.

Pawel Gerr

@Delbert Is there a corresponding issue in EF repo?

The comments to this entry are closed.


IMPORTANT: This is archived - and quite likely outdated - content, only kept online for reference purposes

Please visit thinktecture.com for up-to-date technical content.