File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/Examples/DapperExample Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 3131 }
3232 case DatabaseProvider . MySql :
3333 {
34- // https://github.com/dotnet/roslyn-analyzers/issues/7420
35- #pragma warning disable CA1849 // Call async methods when in an async method
36- builder . Services . AddMySql < AppDbContext > ( connectionString , ServerVersion . AutoDetect ( connectionString ) ,
37- #pragma warning restore CA1849 // Call async methods when in an async method
38- optionsAction : options => SetDbContextDebugOptions ( options ) ) ;
34+ #if NET9_0_OR_GREATER
35+ ServerVersion serverVersion = await ServerVersion . AutoDetectAsync ( connectionString ) ;
36+ #else
37+ ServerVersion serverVersion = ServerVersion . AutoDetect ( connectionString ) ;
38+ #endif
39+
40+ builder . Services . AddMySql < AppDbContext > ( connectionString , serverVersion , optionsAction : options => SetDbContextDebugOptions ( options ) ) ;
3941
4042 break ;
4143 }
You can’t perform that action at this time.
0 commit comments