Skip to content

Commit

Permalink
Refactor using directives and remove conversion methods
Browse files Browse the repository at this point in the history
Removed TinyHelpers.AspNetCore.Swagger directive from Program.cs as its functionality is no longer needed. Added TinyHelpers.EntityFrameworkCore.Converters directive to PropertyBuilderExtensions.cs to utilize its features. Removed HasDateOnlyConversion and HasTimeOnlyConversion methods from PropertyBuilderExtensions class, indicating these conversions are no longer required or have been relocated.
  • Loading branch information
marcominerva committed Dec 4, 2024
1 parent 9481957 commit 73dd781
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion samples/TinyHelpers.AspNetCore.Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using TinyHelpers.AspNetCore.Extensions;
using TinyHelpers.AspNetCore.OpenApi;
using TinyHelpers.AspNetCore.Swagger;

var builder = WebApplication.CreateBuilder(args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ namespace TinyHelpers.EntityFrameworkCore.Extensions;

public static class PropertyBuilderExtensions
{
public static PropertyBuilder<DateOnly> HasDateOnlyConversion<DateOnly>(this PropertyBuilder<DateOnly> propertyBuilder)
=> propertyBuilder.HasConversion<DateOnlyConverter, DateOnlyComparer>();

public static PropertyBuilder<TimeOnly> HasTimeOnlyConversion<TimeOnly>(this PropertyBuilder<TimeOnly> propertyBuilder)
=> propertyBuilder.HasConversion<TimeOnlyConverter, TimeOnlyComparer>();

public static PropertyBuilder<T?> HasJsonConversion<T>(this PropertyBuilder<T?> propertyBuilder, JsonSerializerOptions? jsonSerializerOptions = null, bool useUtcDate = false, bool serializeEnumAsString = false)
{
jsonSerializerOptions ??= new(JsonOptions.Default);
Expand Down

0 comments on commit 73dd781

Please sign in to comment.