Skip to content

Commit

Permalink
update nugets and fix Postgrees
Browse files Browse the repository at this point in the history
  • Loading branch information
olmobrutall committed Nov 10, 2021
1 parent 0d2677d commit 9e4dce9
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Signum.Engine.Extensions/Signum.Engine.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.DirectoryServices" Version="6.0.0" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="6.0.0" />
Expand Down
10 changes: 5 additions & 5 deletions Signum.Engine/Connection/FieldReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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<DateTime>(reader.GetValue(ordinal)).ToDateOnly(),
tcDateOnly => reader.GetFieldValue<DateOnly>(ordinal),
_ => reader.GetFieldValue<DateOnly>(ordinal),
};
return dt;
}
Expand Down
2 changes: 0 additions & 2 deletions Signum.Engine/Connection/PostgreSqlConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Signum.Engine/Signum.Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="3.0.1" />
<PackageReference Include="Npgsql" Version="5.0.10" />
<PackageReference Include="Npgsql" Version="6.0.0" />
<PackageReference Include="Signum.Analyzer" Version="3.2.0" />
<PackageReference Include="Signum.MSBuildTask" Version="5.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Signum.Analyzer" Version="3.2.0" />
<PackageReference Include="Signum.MSBuildTask" Version="5.0.0" />
<PackageReference Include="DocumentFormat.OpenXml" Version="2.14.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="Unofficial.Microsoft.SqlServer.Types" Version="2.0.1" />
Expand Down
2 changes: 1 addition & 1 deletion Signum.Entities/Signum.Entities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Npgsql" Version="5.0.10" />
<PackageReference Include="Npgsql" Version="6.0.0" />
<PackageReference Include="Signum.Analyzer" Version="3.2.0" />
<PackageReference Include="Signum.MSBuildTask" Version="5.0.0" />
</ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions Signum.Entities/TimeZoneManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Signum.React/Signum.React.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Npgsql" Version="5.0.10" />
<PackageReference Include="Npgsql" Version="6.0.0" />
<PackageReference Include="Signum.Analyzer" Version="3.2.0" />
<PackageReference Include="Signum.TSGenerator" Version="6.0.0" />
</ItemGroup>
Expand Down

0 comments on commit 9e4dce9

Please sign in to comment.