@@ -100,13 +100,13 @@ private static IServiceCollection DoAddMySqlDataSource(
100100 } ,
101101 dataSourceLifetime ) ) ;
102102
103- serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( MySqlConnection ) , x => x . GetRequiredService < MySqlDataSource > ( ) . CreateConnection ( ) , connectionLifetime ) ) ;
103+ serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( MySqlConnection ) , static x => x . GetRequiredService < MySqlDataSource > ( ) . CreateConnection ( ) , connectionLifetime ) ) ;
104104
105105#if NET7_0_OR_GREATER
106- serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( DbDataSource ) , x => x . GetRequiredService < MySqlDataSource > ( ) , dataSourceLifetime ) ) ;
106+ serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( DbDataSource ) , static x => x . GetRequiredService < MySqlDataSource > ( ) , dataSourceLifetime ) ) ;
107107#endif
108108
109- serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( DbConnection ) , x => x . GetRequiredService < MySqlConnection > ( ) , connectionLifetime ) ) ;
109+ serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( DbConnection ) , static x => x . GetRequiredService < MySqlConnection > ( ) , connectionLifetime ) ) ;
110110
111111 return serviceCollection ;
112112 }
@@ -133,13 +133,13 @@ private static IServiceCollection DoAddMySqlDataSource(
133133 } ,
134134 dataSourceLifetime ) ) ;
135135
136- serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( MySqlConnection ) , serviceKey , ( sp , sk ) => sp . GetRequiredKeyedService < MySqlDataSource > ( sk ) . CreateConnection ( ) , connectionLifetime ) ) ;
136+ serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( MySqlConnection ) , serviceKey , static ( sp , sk ) => sp . GetRequiredKeyedService < MySqlDataSource > ( sk ) . CreateConnection ( ) , connectionLifetime ) ) ;
137137
138138#if NET7_0_OR_GREATER
139- serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( DbDataSource ) , serviceKey , ( sp , sk ) => sp . GetRequiredKeyedService < MySqlDataSource > ( sk ) , dataSourceLifetime ) ) ;
139+ serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( DbDataSource ) , serviceKey , static ( sp , sk ) => sp . GetRequiredKeyedService < MySqlDataSource > ( sk ) , dataSourceLifetime ) ) ;
140140#endif
141141
142- serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( DbConnection ) , serviceKey , ( sp , sk ) => sp . GetRequiredKeyedService < MySqlConnection > ( sk ) , connectionLifetime ) ) ;
142+ serviceCollection . TryAdd ( new ServiceDescriptor ( typeof ( DbConnection ) , serviceKey , static ( sp , sk ) => sp . GetRequiredKeyedService < MySqlConnection > ( sk ) , connectionLifetime ) ) ;
143143
144144 return serviceCollection ;
145145 }
0 commit comments