Timeline for How do I serialize an object into query-string format?
Current License: CC BY-SA 4.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 9, 2024 at 16:43 | comment | added | Alexei Sosin |
instead of manually stitching everything together in steps 3 and 4, one can use Microsoft.AspNetCore.WebUtilities.QueryHelpers.AddQueryString("", step2)
|
|
| Jan 25, 2021 at 12:24 | comment | added | Jim Yarbro |
This works with the System.Text.Json library as well, just make sure the IDictionary in step 2 is <string, object> instead, and then use x.Value.ToString() in step 3.
|
|
| Aug 7, 2020 at 9:34 | comment | added | devklick | I like the simplicity of this. It's great for flat objects, but no good for nested objects/lists | |
| May 26, 2020 at 16:42 | comment | added | Ashley Kilgour | I used this as it worked out the box for DateTime properties | |
| Jul 10, 2019 at 19:16 | history | answered | yoel halb | CC BY-SA 4.0 |