New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend built-in supported types #2804
Extend built-in supported types #2804
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2804 +/- ##
==========================================
+ Coverage 92.10% 92.14% +0.04%
==========================================
Files 91 91
Lines 3064 3080 +16
Branches 525 526 +1
==========================================
+ Hits 2822 2838 +16
Misses 242 242
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
- Ensure `DateOnly` and `TimeOnly` with for Newtonsoft.Json. - Add System.Text.Json support for `TimeSpan` and `Version`. - Add Int128 and UInt128 support. - Handle `AnnotationsDataType.Upload`. - Create `AnnotationsDataType` mapping dictionary only once. Resolves domaindrivendev#2611.
- Use `TryGetValue()` instead of `ContainsKey()` and indexer. - Apply some IDE refactoring suggestions.
466a55b
to
8fab64d
Compare
@@ -186,7 +197,7 @@ private IEnumerable<DataProperty> GetDataPropertiesFor(JsonObjectContract jsonOb | |||
return dataProperties; | |||
} | |||
|
|||
private static readonly Dictionary<Type, Tuple<DataType, string>> PrimitiveTypesAndFormats = new Dictionary<Type, Tuple<DataType, string>> | |||
private static readonly Dictionary<Type, Tuple<DataType, string>> PrimitiveTypesAndFormats = new() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static readonly Dictionary<Type, Tuple<DataType, string>> PrimitiveTypesAndFormats = new() | |
private static readonly Dictionary<Type, Tuple<DataType, string>> PrimitiveTypesAndFormats = new |
Add test for domaindrivendev#2771 for `DateOnly` values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a #if NET6_0_OR_GREATER ... #endif (snippet) around the test inline data for dateonly and timeonly in the testfiles, like the example below. I can't suggest this change anymore.
#if NET6_0_OR_GREATER [InlineData(typeof(DateOnly), "string", "date")] [InlineData(typeof(TimeOnly), "string", "time")] #endif
There was no need to do that in the |
DateOnly
andTimeOnly
with for Newtonsoft.Json.TimeSpan
andVersion
.AnnotationsDataType.Upload
.AnnotationsDataType
mapping dictionary only once.Resolves #2611
Relates to #2500