Created
October 28, 2021 06:10
-
-
Save MahdiKarimipour/c4f1dc352f9a5b7b27564906537c9787 to your computer and use it in GitHub Desktop.
Enable Caching of Internal Service Providers in Production
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services.AddDbContextPool<IdentityDBContext>(options => | |
| { | |
| options.UseSqlServer(secrets.DbConnectionString, | |
| x => x.MigrationsAssembly("DataAccess") | |
| .EnableRetryOnFailure(maxRetryCount: 3)) | |
| .UseLazyLoadingProxies() | |
| .EnableSensitiveDataLogging(CurrentEnvironment.IsDevelopment()) | |
| .EnableServiceProviderCaching() | |
| .UseLoggerFactory(IdentityDBContext.PropertyAppLoggerFactory); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment