2
2
3
3
public static class DependencyInjection
4
4
{
5
+ #region "SERILOG"
5
6
public static IServiceCollection AddSerilogServices ( this IServiceCollection services )
6
7
{
7
8
services . AddTransient < ILoggerService , LoggerService > ( ) ;
@@ -28,7 +29,9 @@ public static WebApplicationBuilder AddSerilogOptionsBuilder(this WebApplication
28
29
29
30
return builder ;
30
31
}
32
+ #endregion
31
33
34
+ #region "SUPPORTED CULTURES"
32
35
public static IServiceCollection AddSupportedCultures ( this IServiceCollection services , string [ ] cultures )
33
36
{
34
37
var supportedCultures = cultures ;
@@ -53,7 +56,9 @@ public static WebApplication UseLocalizationConfiguration(this WebApplication ap
53
56
54
57
return app ;
55
58
}
59
+ #endregion
56
60
61
+ #region "DATE and TIME"
57
62
public static IMvcBuilder AddDateTimeJsonOptions ( this IMvcBuilder builder )
58
63
{
59
64
builder . AddJsonOptions ( options =>
@@ -93,7 +98,9 @@ public static SwaggerGenOptions AddDateTimeSwaggerGenOptions(this SwaggerGenOpti
93
98
94
99
return options ;
95
100
}
101
+ #endregion
96
102
103
+ #region "JSON"
97
104
public static IMvcBuilder AddSimpleJsonOptions ( this IMvcBuilder builder )
98
105
{
99
106
builder . AddJsonOptions ( options =>
@@ -102,7 +109,9 @@ public static IMvcBuilder AddSimpleJsonOptions(this IMvcBuilder builder)
102
109
} ) ;
103
110
return builder ;
104
111
}
112
+ #endregion
105
113
114
+ #region "DB Context"
106
115
public static IServiceCollection AddDbContextGenericsMethods < TDbContext > ( this IServiceCollection services ) where TDbContext : DbContext
107
116
{
108
117
services . AddScoped < DbContext , TDbContext > ( ) ;
@@ -133,7 +142,9 @@ public static IServiceCollection AddDbContextUseMySql<TDbContext>(this IServiceC
133
142
} ) ;
134
143
return services ;
135
144
}
145
+ #endregion
136
146
147
+ #region "HEALTH CHECKS"
137
148
public static IServiceCollection AddMySqlHealthChecks ( this IServiceCollection services , string connectionString , string nameAsyncCheck )
138
149
{
139
150
services . AddHealthChecks ( )
@@ -221,7 +232,9 @@ public static IEndpointRouteBuilder AddDatabaseHealthChecks(this IEndpointRouteB
221
232
222
233
return builder ;
223
234
}
235
+ #endregion
224
236
237
+ #region "SEND EMAIL"
225
238
public static IServiceCollection AddMailKitEmailSenderService ( this IServiceCollection services , IConfiguration configuration )
226
239
{
227
240
services
@@ -233,4 +246,5 @@ public static IServiceCollection AddMailKitEmailSenderService(this IServiceColle
233
246
234
247
return services ;
235
248
}
249
+ #endregion
236
250
}
0 commit comments