2
2
3
3
public static class DependencyInjection
4
4
{
5
- #region "SERILOG"
6
5
public static IServiceCollection AddSerilogServices ( this IServiceCollection services )
7
6
{
8
7
services . AddTransient < ILoggerService , LoggerService > ( ) ;
@@ -29,9 +28,7 @@ public static WebApplicationBuilder AddSerilogOptionsBuilder(this WebApplication
29
28
30
29
return builder ;
31
30
}
32
- #endregion
33
31
34
- #region "MULTI LANGUAGE"
35
32
public static IServiceCollection AddSupportedCultures ( this IServiceCollection services , string [ ] cultures )
36
33
{
37
34
var supportedCultures = cultures ;
@@ -56,9 +53,7 @@ public static WebApplication UseLocalizationConfiguration(this WebApplication ap
56
53
57
54
return app ;
58
55
}
59
- #endregion
60
56
61
- #region "DATE and TIME ONLY"
62
57
public static IMvcBuilder AddDateTimeJsonOptions ( this IMvcBuilder builder )
63
58
{
64
59
builder . AddJsonOptions ( options =>
@@ -98,9 +93,7 @@ public static SwaggerGenOptions AddDateTimeSwaggerGenOptions(this SwaggerGenOpti
98
93
99
94
return options ;
100
95
}
101
- #endregion
102
96
103
- #region "JSON"
104
97
public static IMvcBuilder AddSimpleJsonOptions ( this IMvcBuilder builder )
105
98
{
106
99
builder . AddJsonOptions ( options =>
@@ -109,9 +102,7 @@ public static IMvcBuilder AddSimpleJsonOptions(this IMvcBuilder builder)
109
102
} ) ;
110
103
return builder ;
111
104
}
112
- #endregion
113
105
114
- #region "EFCORE DBContext Generics"
115
106
public static IServiceCollection AddDbContextGenericsMethods < TDbContext > ( this IServiceCollection services ) where TDbContext : DbContext
116
107
{
117
108
services . AddScoped < DbContext , TDbContext > ( ) ;
@@ -121,9 +112,7 @@ public static IServiceCollection AddDbContextGenericsMethods<TDbContext>(this IS
121
112
122
113
return services ;
123
114
}
124
- #endregion
125
115
126
- #region "EFCORE DBContext"
127
116
public static IServiceCollection AddDbContextUseMySql < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
128
117
{
129
118
services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -144,9 +133,7 @@ public static IServiceCollection AddDbContextUseMySql<TDbContext>(this IServiceC
144
133
} ) ;
145
134
return services ;
146
135
}
147
- #endregion
148
136
149
- #region "DATABASE HEALTH CHECKS"
150
137
public static IServiceCollection AddMySqlHealthChecks ( this IServiceCollection services , string connectionString , string nameAsyncCheck )
151
138
{
152
139
services . AddHealthChecks ( )
@@ -213,9 +200,7 @@ public static IEndpointRouteBuilder AddDatabaseHealthChecks(this IEndpointRouteB
213
200
214
201
return builder ;
215
202
}
216
- #endregion
217
203
218
- #region "MAILKIT"
219
204
public static IServiceCollection AddMailKitEmailSenderService ( this IServiceCollection services , IConfiguration configuration )
220
205
{
221
206
services
@@ -227,5 +212,4 @@ public static IServiceCollection AddMailKitEmailSenderService(this IServiceColle
227
212
228
213
return services ;
229
214
}
230
- #endregion
231
215
}
0 commit comments