I get the error message "System.InvalidOperationException: A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext" sometimes when I have a blazor server page that uses sub components that have different IRepository injected into them. And they all have code that gets data from the db on OnInitializedAsync.
I guess I'm using repositories all wrong. How can I make this safe? When I use the DBContext directly it all works fine. How can I work around this?
So sorry if this is a completely wrong place for this post.
I get the error message "System.InvalidOperationException: A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext" sometimes when I have a blazor server page that uses sub components that have different IRepository injected into them. And they all have code that gets data from the db on OnInitializedAsync.
I guess I'm using repositories all wrong. How can I make this safe? When I use the DBContext directly it all works fine. How can I work around this?
So sorry if this is a completely wrong place for this post.