Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

[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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant