I'm using Blazor Server.
I have set up a partial class called DataContextComponent that uses DBContextFactory to create an instance of dbContext for the lifetime of that component. I thought this would be enough to keep components isolated, but I'm finding that if there is a parent and child component that both inherit from DataContextComponent and fetch data using EF Core, I get an error saying "a second operation was started on this context instance before a previous operation completed." Am I doing something wrong?
I'd like to make reusable components that fetch their own data that I can use throughout the application. Is this an anti pattern?
Thanks for the advice!