Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

InvalidOperationException: An attempt was made to use the context while it is being configured. A DbContext instance cannot be used inside OnConfiguring since it is still being configured at this point.

$
0
0

I have

1: DbContext
2: Respository
3:Service

Service take Repository as dependency and repository take DbContext as dependency.

 Problem: I have registered Repository,Service as "AddTransient" when I execute application sometimes I faced issues

"InvalidOperationException: An attempt was made to use the context while it is being configured. A DbContext instance cannot be used inside OnConfiguring since it is still being configured at this point."


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>