D
D
Dmitry Gavrilenko2015-11-16 12:30:15
JSON
Dmitry Gavrilenko, 2015-11-16 12:30:15

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

1 answer(s)
D
Dasha Tsiklauri, 2015-11-16
@dasha_programmist

and you return

return new {
    Executors = Users.Select(i=>i.Id).ToArray()
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question