-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EntityFrameworkCore - Blazor Server Guidance #280
Comments
Hi @jlipford, I've coincidentally been working on this in another project this week. I think it's a fairly niche use case but I've submitted my code as a pull request should you wish to use it either verbatim or for inspiration. Essentially it boiled down to two options for me:
I opted for the latter for a number of reasons, chief amongst which was that, should I choose to swap out my EntityFramework based repositories for say DAPPER ones, it shouldn't affect consumers of the IRepository interface. The downside of this approach (or at least my implementation of it) is that you lose Entity Framework's change tracking magic. For me, this isn't a problem since I manage all my entity state in the Domain Layer and treat all of my objects as disconnected anyway here's a really good article that goes into more detail. Hope some of this is useful to you. Very interested to hear the opinions of others, especially if they differ from mine. |
Closing as inactive. |
Any opinions on the use of this library and the abstract (included) repository for use with Blazor Server given this guidance? https://docs.microsoft.com/en-us/aspnet/core/blazor/blazor-server-ef-core?view=aspnetcore-6.0
Using DBContextFactory vs direct DbContext and the lifetime of those objects and thread safety?
Can a version of the included RepositoryBase (for EntityFrameworkCore) implementing disposable be provided? Or expose the underyling context as protected instead of private?
Maybe I am overthinking it but worried about thread safety using circuits but I love this library!
Great work as usual @ardalis !!!
The text was updated successfully, but these errors were encountered: