Jan 31, 2021, 8:50 PM
Json serialization issue ?
is the Ext.Net serialize the object(s) by depending on the options specified at startup ?
actually I tried 2 options shown below but result never changed :(
but at this point seems like Ext.Net does not render the field(s) in class by depending on MVC JsonOptins.
please I'd be liked you to suggest me any idea/offer :)
actually I tried 2 options shown below but result never changed :(
.AddRazorPages().AddJsonOptions(options => {
options.JsonSerializerOptions.IncludeFields = true;
options.JsonSerializerOptions.DefaultIgnoreCondition = WhenWritingNull;
})
.AddRazorPages().AddNewtonsoftJson(options => {
options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;
})
I have a class named XYZ; and wanna return a List<XYZ> to the client on anciton -> OnPostBUTTON_CLICKpublic IActionResult OnPostBUTTON_CLICK()
{
var data = new List<XYZ>() {
new XYZ() {field1="val-11", field2= "val-12" },
new XYZ() {field1="val-21", field2= "val-22" }
};
this.X().Call("js-function", data);
return this.Direct();
}
private class XYZ{
public string field1;
public string field2;
}
but at this point seems like Ext.Net does not render the field(s) in class by depending on MVC JsonOptins.
please I'd be liked you to suggest me any idea/offer :)