-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default DateTimeKind configuration (#195)
* Default DateTimeKind configuration * moving usage to mapper config * mapper doc update * test: add DateTime Kind tests --------- Co-authored-by: AliReZa Sabouri <[email protected]>
- Loading branch information
1 parent
d47a0f0
commit abd8c16
Showing
6 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
test/EntityFrameworkPostgreSqlIntegrationTests/Issue188Tests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using EntityFrameworkIntegrationTests.cs; | ||
using Microsoft.EntityFrameworkCore; | ||
using Xunit; | ||
|
||
namespace Gridify.Tests; | ||
|
||
public class Issue188Tests | ||
{ | ||
|
||
private readonly MyDbContext _dbContext = new(); | ||
|
||
[Fact] | ||
public void DateTimeFilteringWithUTCKind_UsingGridifyMapper_ShouldNotThrowException() | ||
{ | ||
var mapper = new GridifyMapper<User>(q => q.DefaultDateTimeKind = DateTimeKind.Utc) | ||
.GenerateMappings(); | ||
_dbContext.Users.ApplyFiltering("CreateDate>2023-11-14", mapper).ToQueryString(); | ||
} | ||
|
||
[Fact] | ||
public void DateTimeFilteringWithUTCKind_UsingGlobalConfiguration_ShouldNotThrowException() | ||
{ | ||
GridifyGlobalConfiguration.DefaultDateTimeKind = DateTimeKind.Utc; | ||
_dbContext.Users.ApplyFiltering("CreateDate>2023-11-14").ToQueryString(); | ||
GridifyGlobalConfiguration.DefaultDateTimeKind = null; | ||
} | ||
|
||
} | ||
|
||
|