Hello.
Is it possible to force the UI (both mvc and angular) to send true/false values instead of strings ("true"/"false")? And *null *instead of "" (empty string) for null values? System.Text.Json serializer requires this.
Thanks.
3 Answer(s)
-
0
Hi @npdevs
I just checked the tenant settings page on Angular app and it sends
true
to server when you update settings. Could you tell me where did you see the"true"
string ?Could you also share a sample case for the
null
value ? -
0
Hello,
About the second case. When opening Administration/Users page, UI sends GetUsersInput:
{"filter":"","permissions":[],"role":"","onlyLockedUsers":false,"maxResultCount":10,"skipCount":0}
public class GetUsersInput : PagedAndSortedInputDto, IShouldNormalize, IGetUsersInput { ... public int? Role { get; set; } ... }
Looks like Newtonsoft.Json serializer allows using empty strings as null values, but System.Text.Json serializer doesn't. I found a workaround for this case, but it's better to have a native solution.
Thanks.
-
0
Hi @npdevs
We are working on migrating to
System.Text.Json
and I assume it will be completed with .NET 8 upgrade.