Answer the question
In order to leave comments, you need to log in
How to form a json string in newtonsoft.json according to my specific rules?
Tell me how to form a json string in newtonsoft.json according to my specific rules? For example, in an object I have a List of User types. Now the transformation returns me the string
"Executors":[{"Id":1},{"Id":3},{"Id":8},{"Id":4},{"Id":9}, {"Id":5},{"Id":6},{"Id":7},{"Id":10},{"Id":11},{"Id":12},{" Id":13},{"Id":14},{"Id":15},{"Id":16}], but it should return "Executors":[1,2,3,4,5, 6,7,8,9]
Answer the question
In order to leave comments, you need to log in
and you return
return new {
Executors = Users.Select(i=>i.Id).ToArray()
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question