0

I'm sending the following :

{
    "setIds": ["1", "2"],
    "folderIds": ["3", "4"],
    "filter": "FILTERED"
};

To an API endpoint that accepts a SessionDto:

[DataContract]
public class SessionDto
{

    [DataMember(EmitDefaultValue = true)]
    public Array FolderIds { get; set; }

    [DataMember(EmitDefaultValue = true)]
    public Array SetIds { get; set; }

    [DataMember(IsRequired = true)]
    public string Filter { get; set; }

}

SetIds and FolderIds are always null though; Filter comes through just fine. I'm using newtonsoft.json.serialization. Any idea why this wouldn't be working, or how I can further debug?

1 Answer 1

2
[DataMember(EmitDefaultValue = true)]
    public int[] FolderIds { get; set; }

    [DataMember(EmitDefaultValue = true)]
    public int[] SetIds { get; set; }

    [DataMember(IsRequired = true)]
    public string Filter { get; set; }

Try int arrays

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.