@@ -100,13 +100,13 @@ private static IServiceCollection DoAddMySqlDataSource(
100
100
} ,
101
101
dataSourceLifetime ) ) ;
102
102
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 ) ) ;
104
104
105
105
#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 ) ) ;
107
107
#endif
108
108
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 ) ) ;
110
110
111
111
return serviceCollection ;
112
112
}
@@ -133,13 +133,13 @@ private static IServiceCollection DoAddMySqlDataSource(
133
133
} ,
134
134
dataSourceLifetime ) ) ;
135
135
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 ) ) ;
137
137
138
138
#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 ) ) ;
140
140
#endif
141
141
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 ) ) ;
143
143
144
144
return serviceCollection ;
145
145
}
0 commit comments