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

Commit ae683a4

Browse files
author
Angelo Pirola
committed
Pulizia codice
1 parent e703f93 commit ae683a4

File tree

4 files changed

+2
-24
lines changed

4 files changed

+2
-24
lines changed

src/NET6CustomLibrary/DateTime/Converters/DateOnlyConverter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
2-
31
namespace NET6CustomLibrary.DateTime.Converters;
42

53
//public class DateOnlyConverter : JsonConverter<DateOnly>

src/NET6CustomLibrary/DateTime/TypeConverters/DateOnlyTypeConverter.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
namespace NET6CustomLibrary.DateTime.TypeConverters;
22

3-
#if NET6_0
43
internal class DateOnlyTypeConverter : TypeConverter
54
{
65
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
@@ -42,5 +41,4 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul
4241

4342
return base.ConvertTo(context, culture, value, destinationType);
4443
}
45-
}
46-
#endif
44+
}

src/NET6CustomLibrary/DateTime/TypeConverters/TimeOnlyTypeConverter.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
namespace NET6CustomLibrary.DateTime.TypeConverters;
22

3-
#if NET6_0
43
public class TimeOnlyTypeConverter : TypeConverter
54
{
65
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
@@ -42,5 +41,4 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul
4241

4342
return base.ConvertTo(context, culture, value, destinationType);
4443
}
45-
}
46-
#endif
44+
}

src/NET6CustomLibrary/Extensions/DependencyInjection.cs

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

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

3029
return builder;
3130
}
32-
#endregion
3331

34-
#region "MULTI LANGUAGE"
3532
public static IServiceCollection AddSupportedCultures(this IServiceCollection services, string[] cultures)
3633
{
3734
var supportedCultures = cultures;
@@ -56,9 +53,7 @@ public static WebApplication UseLocalizationConfiguration(this WebApplication ap
5653

5754
return app;
5855
}
59-
#endregion
6056

61-
#region "DATE and TIME ONLY"
6257
public static IMvcBuilder AddDateTimeJsonOptions(this IMvcBuilder builder)
6358
{
6459
builder.AddJsonOptions(options =>
@@ -98,9 +93,7 @@ public static SwaggerGenOptions AddDateTimeSwaggerGenOptions(this SwaggerGenOpti
9893

9994
return options;
10095
}
101-
#endregion
10296

103-
#region "JSON"
10497
public static IMvcBuilder AddSimpleJsonOptions(this IMvcBuilder builder)
10598
{
10699
builder.AddJsonOptions(options =>
@@ -109,9 +102,7 @@ public static IMvcBuilder AddSimpleJsonOptions(this IMvcBuilder builder)
109102
});
110103
return builder;
111104
}
112-
#endregion
113105

114-
#region "EFCORE DBContext Generics"
115106
public static IServiceCollection AddDbContextGenericsMethods<TDbContext>(this IServiceCollection services) where TDbContext : DbContext
116107
{
117108
services.AddScoped<DbContext, TDbContext>();
@@ -121,9 +112,7 @@ public static IServiceCollection AddDbContextGenericsMethods<TDbContext>(this IS
121112

122113
return services;
123114
}
124-
#endregion
125115

126-
#region "EFCORE DBContext"
127116
public static IServiceCollection AddDbContextUseMySql<TDbContext>(this IServiceCollection services, string connectionString, int retryOnFailure) where TDbContext : DbContext
128117
{
129118
services.AddDbContextPool<TDbContext>(optionBuilder =>
@@ -144,9 +133,7 @@ public static IServiceCollection AddDbContextUseMySql<TDbContext>(this IServiceC
144133
});
145134
return services;
146135
}
147-
#endregion
148136

149-
#region "DATABASE HEALTH CHECKS"
150137
public static IServiceCollection AddMySqlHealthChecks(this IServiceCollection services, string connectionString, string nameAsyncCheck)
151138
{
152139
services.AddHealthChecks()
@@ -213,9 +200,7 @@ public static IEndpointRouteBuilder AddDatabaseHealthChecks(this IEndpointRouteB
213200

214201
return builder;
215202
}
216-
#endregion
217203

218-
#region "MAILKIT"
219204
public static IServiceCollection AddMailKitEmailSenderService(this IServiceCollection services, IConfiguration configuration)
220205
{
221206
services
@@ -227,5 +212,4 @@ public static IServiceCollection AddMailKitEmailSenderService(this IServiceColle
227212

228213
return services;
229214
}
230-
#endregion
231215
}

0 commit comments

Comments
 (0)