You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am struggling how to limit the payload only to fields only there were set (skip default, null fields).
If I use JsonIgnore fields are being ignored during POST but also during GET
public class MyEntity
{
public Guid Id { get; set; } //Key
public Code {get; set; } //Alternate Key
public Name { get; set;}
}
var entity = new MyEntity
{
Code = "ABC",
Name = "New ABC"
};
await client.For<MyEntity>.Set(entity).InsertEntryAsync();
I would like to achieve JSON beeing generated is something like:
I was trying to use JSONIgnore with condition [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
But is not currently supported.
Perhaps there is another way??
Regards,
Sebastian
The text was updated successfully, but these errors were encountered:
Hi,
I am struggling how to limit the payload only to fields only there were set (skip default, null fields).
If I use JsonIgnore fields are being ignored during POST but also during GET
I would like to achieve JSON beeing generated is something like:
instead what gets generated is
I was trying to use JSONIgnore with condition [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
But is not currently supported.
Perhaps there is another way??
Regards,
Sebastian
The text was updated successfully, but these errors were encountered: