diff --git a/Signum.Engine.Extensions/Signum.Engine.Extensions.csproj b/Signum.Engine.Extensions/Signum.Engine.Extensions.csproj index 2ca4f7fa2f..c55c1403bd 100644 --- a/Signum.Engine.Extensions/Signum.Engine.Extensions.csproj +++ b/Signum.Engine.Extensions/Signum.Engine.Extensions.csproj @@ -26,7 +26,7 @@ - + diff --git a/Signum.Engine/Connection/FieldReader.cs b/Signum.Engine/Connection/FieldReader.cs index c387d03454..fa7dd3ebd9 100644 --- a/Signum.Engine/Connection/FieldReader.cs +++ b/Signum.Engine/Connection/FieldReader.cs @@ -16,7 +16,7 @@ public class FieldReader private const TypeCode tcGuid = (TypeCode)20; private const TypeCode tcTimeSpan = (TypeCode)21; private const TypeCode tcDateTimeOffset = (TypeCode)22; - private const TypeCode tcNpgsqlDate = (TypeCode)24; + private const TypeCode tcDateOnly = (TypeCode)24; public int? LastOrdinal; public string? LastMethodName; @@ -36,8 +36,8 @@ TypeCode GetTypeCode(int ordinal) if (type == typeof(DateTimeOffset)) tc = tcDateTimeOffset; - if (type == typeof(NpgsqlTypes.NpgsqlDate)) - tc = tcNpgsqlDate; + if (type == typeof(DateOnly)) + tc = tcDateOnly; } return tc; } @@ -391,8 +391,8 @@ public DateOnly GetDateOnly(int ordinal) var dt = typeCodes[ordinal] switch { TypeCode.DateTime => reader.GetDateTime(ordinal).ToDateOnly(), - FieldReader.tcNpgsqlDate => ((DateTime)((NpgsqlDataReader)reader).GetDate(ordinal)).ToDateOnly(), - _ => ReflectionTools.ChangeType(reader.GetValue(ordinal)).ToDateOnly(), + tcDateOnly => reader.GetFieldValue(ordinal), + _ => reader.GetFieldValue(ordinal), }; return dt; } diff --git a/Signum.Engine/Connection/PostgreSqlConnector.cs b/Signum.Engine/Connection/PostgreSqlConnector.cs index 33b35807e6..3e2f6b4f76 100644 --- a/Signum.Engine/Connection/PostgreSqlConnector.cs +++ b/Signum.Engine/Connection/PostgreSqlConnector.cs @@ -506,8 +506,6 @@ public override DbParameter CreateParameter(string parameterName, AbstractDbType { if (value is DateTime dt) AssertDateTime(dt); - else if (value is DateOnly d) - value = new NpgsqlDate(d.ToDateTimeAutoUTC()); } var result = new Npgsql.NpgsqlParameter(parameterName, value ?? DBNull.Value) diff --git a/Signum.Engine/Signum.Engine.csproj b/Signum.Engine/Signum.Engine.csproj index abfebe59e8..20fbb6942b 100644 --- a/Signum.Engine/Signum.Engine.csproj +++ b/Signum.Engine/Signum.Engine.csproj @@ -16,7 +16,7 @@ - + diff --git a/Signum.Entities.Extensions/Signum.Entities.Extensions.csproj b/Signum.Entities.Extensions/Signum.Entities.Extensions.csproj index e7f35f23c3..f4b56931ae 100644 --- a/Signum.Entities.Extensions/Signum.Entities.Extensions.csproj +++ b/Signum.Entities.Extensions/Signum.Entities.Extensions.csproj @@ -14,7 +14,7 @@ - + diff --git a/Signum.Entities/Signum.Entities.csproj b/Signum.Entities/Signum.Entities.csproj index b5464d81c1..24cb552c7b 100644 --- a/Signum.Entities/Signum.Entities.csproj +++ b/Signum.Entities/Signum.Entities.csproj @@ -7,7 +7,7 @@ - + diff --git a/Signum.Entities/TimeZoneManager.cs b/Signum.Entities/TimeZoneManager.cs index 07b653a0e3..1b27c6465f 100644 --- a/Signum.Entities/TimeZoneManager.cs +++ b/Signum.Entities/TimeZoneManager.cs @@ -49,11 +49,6 @@ public static DateTime Now public static DateOnly Today => Now.ToDateOnly(); - public static DateTime ToDateTimeAutoUTC(this DateOnly date) - { - return date.ToDateTime(new TimeOnly(), Mode == TimeZoneMode.Local ? DateTimeKind.Local : DateTimeKind.Utc); - } - public static DateTime ToUserInterface(this DateTime dbDateTime) { if (Mode == TimeZoneMode.Local || dbDateTime.Kind == DateTimeKind.Local) diff --git a/Signum.React/Signum.React.csproj b/Signum.React/Signum.React.csproj index 40cfab3f2c..6a7906c89e 100644 --- a/Signum.React/Signum.React.csproj +++ b/Signum.React/Signum.React.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers all - +