Skip to content
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

[Feat] Factory to provide ItemsQueryable #353

Open
nadirbongiovanni opened this issue Sep 14, 2021 · 0 comments
Open

[Feat] Factory to provide ItemsQueryable #353

nadirbongiovanni opened this issue Sep 14, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@nadirbongiovanni
Copy link

I'm struggling on managing correctly the EFCore DbContext lifecycle in a project using BlazorTable.
If I define as ItemsQueryable parameter on the component a DbSet from the context, as Microsoft guidelines suggest, I dispose it on every request, resulting BlazorTable to thron ObjectDisposedException. The only workaround is keeping the context alive through all the application, which is not adviceable.
The idea is to provide another parameter to the component called ItemsQueryableFactory which accepts a Func<IQueryable> which allows the component to be provided a new IQueryable every time it needs and allowing the application using the component to follow the context lifecycle guidelines.

@nadirbongiovanni nadirbongiovanni added the enhancement New feature or request label Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant