CreatedAtRoute with DateTimeOffset gives incorrect URL #11134
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
investigate
Milestone
Describe the bug
DateTimeOffset string is formatted incorrectly in location link after returning CreatedAtRoute result.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
String formatted in a manner that makes it parseable by AspNetCore if the target route is called.
Can be achieved manually by doing this:
return CreatedAtRoute(nameof(GetConfig), new { name = config.MonitorName, validFrom = config.ValidFrom.ToString() }, null);
that is, calling ToString() explicitly. Then the location parameter becomes:
http://localhost:8081/api/monitor/IntradayOutlierMonitor/IntradayOutlierMonitor/2019-06-13%2007%3A27%3A21%20%2B00%3A00
which is accetable to AspNetCore
Screenshots
I get errors uploading screenshots, but trying to use the uri results in the following json
The text was updated successfully, but these errors were encountered: