@@ -101,6 +101,14 @@ public static IServiceCollection AddDbContextGenericsMethods<TDbContext>(this IS
101
101
return services ;
102
102
}
103
103
104
+ /// <summary>
105
+ /// Extension method per aggiungere un DbContext di tipo TDbContext con il provider MySQL / MariaDB
106
+ /// </summary>
107
+ /// <typeparam name="TDbContext"></typeparam>
108
+ /// <param name="services"></param>
109
+ /// <param name="connectionString"></param>
110
+ /// <param name="retryOnFailure"></param>
111
+ /// <returns></returns>
104
112
public static IServiceCollection AddDbContextUseMySql < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
105
113
{
106
114
services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -122,6 +130,14 @@ public static IServiceCollection AddDbContextUseMySql<TDbContext>(this IServiceC
122
130
return services ;
123
131
}
124
132
133
+ /// <summary>
134
+ /// Extension method per aggiungere un DbContext di tipo TDbContext con il provider Postgres
135
+ /// </summary>
136
+ /// <typeparam name="TDbContext"></typeparam>
137
+ /// <param name="services"></param>
138
+ /// <param name="connectionString"></param>
139
+ /// <param name="retryOnFailure"></param>
140
+ /// <returns></returns>
125
141
public static IServiceCollection AddDbContextUsePostgres < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
126
142
{
127
143
services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -144,6 +160,14 @@ public static IServiceCollection AddDbContextUsePostgres<TDbContext>(this IServi
144
160
return services ;
145
161
}
146
162
163
+ /// <summary>
164
+ /// Extension method per aggiungere un DbContext di tipo TDbContext con il provider SQL Server
165
+ /// </summary>
166
+ /// <typeparam name="TDbContext"></typeparam>
167
+ /// <param name="services"></param>
168
+ /// <param name="connectionString"></param>
169
+ /// <param name="retryOnFailure"></param>
170
+ /// <returns></returns>
147
171
public static IServiceCollection AddDbContextUseSQLServer < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
148
172
{
149
173
services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -162,10 +186,16 @@ public static IServiceCollection AddDbContextUseSQLServer<TDbContext>(this IServ
162
186
optionBuilder . UseSqlServer ( connectionString ) ;
163
187
}
164
188
} ) ;
165
-
166
189
return services ;
167
190
}
168
191
192
+ /// <summary>
193
+ /// Extension method per aggiungere un DbContext di tipo TDbContext con il provider SQLite
194
+ /// </summary>
195
+ /// <typeparam name="TDbContext"></typeparam>
196
+ /// <param name="services"></param>
197
+ /// <param name="connectionString"></param>
198
+ /// <returns></returns>
169
199
public static IServiceCollection AddDbContextUseSQLite < TDbContext > ( this IServiceCollection services , string connectionString ) where TDbContext : DbContext
170
200
{
171
201
services . AddDbContextPool < TDbContext > ( optionsBuilder =>
0 commit comments