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

Update the Blazor CRUD scaffolder to use IDbContextFactory instead of injecting the DbContext directly in to components #2693

Open
danroth27 opened this issue Mar 28, 2024 · 2 comments

Comments

@danroth27
Copy link
Member

We've received feedback from users that the component code generated by the Blazor CRUD scaffolder should use the IDbContextFactory instead of injecting the DbContext directly to avoid making multiple overlapping queries with the same DbContext instance. With static server-side rendering this is less likely to happen, but we think it's best to make the change to be in line with our documented Blazor guidance.

@deepchoudhery
Copy link
Member

deepchoudhery commented Jul 1, 2024

addressed #2835, will be released for .NET 8 and .NET 9 Preview 6 next week!

@thomasclaudiushuber
Copy link

thomasclaudiushuber commented Aug 5, 2024

Just wanted to send some love here! ❤️

I'm working on a new Pluralsight course called "Building a Data-driven Blazor Server Application with EF Core" and while recording the demo of the scaffolder I just noticed that the generated code is using IDbContextFactory. That's fantastic! Thank you everyone!

I guess this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants