Skip to content

Commit

Permalink
Update for date time fix (#55)
Browse files Browse the repository at this point in the history
* Update ExpressionBuilder.cs

* Update DynamicQueryBuilder.csproj
  • Loading branch information
ysnozts authored Sep 18, 2024
1 parent 108a1c6 commit c22088a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions DynamicQueryBuilder/DynamicQueryBuilder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<SignAssembly>false</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Version>1.0.5</Version>
<AssemblyVersion>1.0.0.5</AssemblyVersion>
<FileVersion>1.0.0.5</FileVersion>
<Version>1.0.6</Version>
<AssemblyVersion>1.0.0.6</AssemblyVersion>
<FileVersion>1.0.0.6</FileVersion>
<PackageReleaseNotes>Enable dataset null search operations</PackageReleaseNotes>
<PackageLicenseExpression></PackageLicenseExpression>
</PropertyGroup>
Expand Down
7 changes: 6 additions & 1 deletion DynamicQueryBuilder/ExpressionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,11 @@ internal static Expression BuildFilterExpression(ParameterExpression param, Filt
: null;
}

if (convertedValue is DateTime dateTimeValue)
{
convertedValue = DateTime.SpecifyKind(dateTimeValue, DateTimeKind.Utc).ToUniversalTime();
}

Expression constant = Expression.Constant(convertedValue);

switch (filter.Operator)
Expand Down Expand Up @@ -562,4 +567,4 @@ private static bool AreCountsMatching(string[] operations, string[] parameterNam
return new int[] { operations.Length, parameterNames.Length, parameterValues.Length }.Distinct().Count() == 1;
}
}
}
}

0 comments on commit c22088a

Please sign in to comment.