I have a JSON that looks something like this:
"items": [
"something": "",
"something_2": "",
"field_of_interest": {
"blah": [
{
"placeholder": "1",
"category": "random"
},
{
"placeholder": "2",
"category": "random",
"field_to_null": {
"something_here": "",
}
}
]
}
]
I am trying to set the "field_to_null" field to null. These JSON fields are all encapsulated into objects and I have an expression that looks like this:
Items.Select(x => x.FieldOfInterest)
.Select(y => y.Blah
.Select(z => z.FieldToNull).ToList().ForEach(a => a = null));
But I get an error on the second .Select
. Error found here. Items
is a List of Items
objects and Blah
is a List of FieldOfInterest
objects. I am fairly new to C# and writing lambda linq expressions, so any help is appreciated.