I have a .NET Core 3.1 application that defines a method similar to the following:
[ServiceMethod]
[Documentation("Gets a copy of the local log records that fall within the specified period in one of the supported formats (JSON, XML, TEXT).")]
[ApiMethod(HttpApiMethod = ApiRequestMethod.Post, HttpApiPath = "Logger/GetLog")]
public Binary GetLogRecords(
[Documentation("Starting date")] DateTime start,
[Documentation("Ending date")] DateTime end,
[Documentation("Required output format: JSON, XML, TEXT")] LogFormat format)
{
...
}
The ServiceMethod call work fine, but the ApiMethod seems to have a DateTime parsing issue. If the following JSON payload is sent to the method:
{
"start":"2021-08-06T15:44:38.1489",
"end":"2021-08-07T13:15:20-04:00",
"format":"JSON"
}
The value of start becomes “15:44:38.1490000” – looks like it rounded up to the nearest ms? This is actually causing one of our test scenarios to fail because the string “2021-08-06T15:44:38.1489” was specifically chosen to match the first entry in a log file.