Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit f78dc4b

Browse files
author
Angelo Pirola
committed
Riorganizzazione del codice
1 parent 00cdf1d commit f78dc4b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/NET6CustomLibrary/Extensions/DependencyInjection.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
public static class DependencyInjection
44
{
5+
#region "SERILOG"
56
public static IServiceCollection AddSerilogServices(this IServiceCollection services)
67
{
78
services.AddTransient<ILoggerService, LoggerService>();
@@ -28,7 +29,9 @@ public static WebApplicationBuilder AddSerilogOptionsBuilder(this WebApplication
2829

2930
return builder;
3031
}
32+
#endregion
3133

34+
#region "SUPPORTED CULTURES"
3235
public static IServiceCollection AddSupportedCultures(this IServiceCollection services, string[] cultures)
3336
{
3437
var supportedCultures = cultures;
@@ -53,7 +56,9 @@ public static WebApplication UseLocalizationConfiguration(this WebApplication ap
5356

5457
return app;
5558
}
59+
#endregion
5660

61+
#region "DATE and TIME"
5762
public static IMvcBuilder AddDateTimeJsonOptions(this IMvcBuilder builder)
5863
{
5964
builder.AddJsonOptions(options =>
@@ -93,7 +98,9 @@ public static SwaggerGenOptions AddDateTimeSwaggerGenOptions(this SwaggerGenOpti
9398

9499
return options;
95100
}
101+
#endregion
96102

103+
#region "JSON"
97104
public static IMvcBuilder AddSimpleJsonOptions(this IMvcBuilder builder)
98105
{
99106
builder.AddJsonOptions(options =>
@@ -102,7 +109,9 @@ public static IMvcBuilder AddSimpleJsonOptions(this IMvcBuilder builder)
102109
});
103110
return builder;
104111
}
112+
#endregion
105113

114+
#region "DB Context"
106115
public static IServiceCollection AddDbContextGenericsMethods<TDbContext>(this IServiceCollection services) where TDbContext : DbContext
107116
{
108117
services.AddScoped<DbContext, TDbContext>();
@@ -133,7 +142,9 @@ public static IServiceCollection AddDbContextUseMySql<TDbContext>(this IServiceC
133142
});
134143
return services;
135144
}
145+
#endregion
136146

147+
#region "HEALTH CHECKS"
137148
public static IServiceCollection AddMySqlHealthChecks(this IServiceCollection services, string connectionString, string nameAsyncCheck)
138149
{
139150
services.AddHealthChecks()
@@ -221,7 +232,9 @@ public static IEndpointRouteBuilder AddDatabaseHealthChecks(this IEndpointRouteB
221232

222233
return builder;
223234
}
235+
#endregion
224236

237+
#region "SEND EMAIL"
225238
public static IServiceCollection AddMailKitEmailSenderService(this IServiceCollection services, IConfiguration configuration)
226239
{
227240
services
@@ -233,4 +246,5 @@ public static IServiceCollection AddMailKitEmailSenderService(this IServiceColle
233246

234247
return services;
235248
}
249+
#endregion
236250
}

0 commit comments

Comments
 (0)