How to remove a group of elements in json for a particular id?

Json is written in the parameter responseString:
{"response":{"items":[{"id":1397,"date":1559977207,"owner_id":-56279925,"from_id":-56279925,"post_type":"post","text":"\"Java storm!\" - #camp on programming in #Java for students aged 12 to 17 in Kazan. \n\Organizatory the Higher school of ITIS KFU and the Center for Children's Intellectual Development \"Brain storm\". Classes are held from Monday to Friday at Kazan Federal University.\n\Padres venue: Kazan, Professora nuzhina, 2 (KSK KFU\"UNIX\", the coworking of the Higher school of ITIS). Participants will learn the basics of Java development, write your web app and will work in a team. Particular emphasis is placed on learning object-oriented programming in Java.\n\after lunch, the guys are waiting for games, quests, tours of the city. Schedule of classes:\n - 09:00 - 12:00 - classes :Programming Java;\n - 12:00 - 13:00 - lunch\n - 13:00 - 17:00 - games, quests, a tour of the it Park, excursions to museums of Kazan Federal University.\n\NIN the cost of changing the included 2 meals a day. Read more: +7 900 324 32 60 and https:\/\/www.kidsreview.ru\/world\/catalog\/camps\/java-shturm-lager-po-programmirovaniyu-na-java-dlya-shkolnikov-12-17-let-v-kazani","marked_as_ads":0,"attachments":[{"type":"photo","photo":{"id":456239404,"album_id":-7,"owner_id":-56279925,"user_id":100,"sizes":[{"type":"m","url":"https:\/\/pp.userapi.com\/c849520\/v849520352\/1b5397\/hV3d_sFrXi0.jpg","width":130,"height":87},{"type":"o","url":"https:\/\/pp.userapi.com\/c849520\/v849520352\/1b5399\/Wl0GmyNEA-U.jpg","width":130,"height":87},{"type":"p","url":"https:\/\/pp.userapi.com\/c849520\/v849520352\/1b539a\/diK8J6Q7BhU.jpg","width":200,"height":133},{"type":"q","url":"https:\/\/pp.userapi.com\/c849520\/v849520352\/1b539b\/jQTm6l9A2Ak.jpg","width":320,"height":213},{"type":"r","url":"https:\/\/pp.userapi.com\/c849520\/v849520352\/1b539c\/oYNiLlZa3x8.jpg","width":510,"height":340},{"type":"s","url":"https:\/\/pp.userapi.com\/c849520\/v849520352\/1b5396\/awe2T5YUJ7o.jpg","width":75,"height":50},{"type":"x","url":"https:\/\/pp.userapi.com\/c849520\/v849520352\/1b5398\/8FnAsa_8G4w.jpg","width":600,"height":400}],"text":"","date":1559947643,"access_key":"83c3c6d0fa120c0326"}},{"type":"link","link":{"url":"https:\/\/www.kidsreview.ru\/world\/catalog\/camps\/java-shturm-lager-po-programmirovaniyu-na-java-dlya-shkolnikov-12-17-let-v-kazani","title":"\"Java storm!\", camp programming in Java for students aged 12 to 17 in Kazan, the 11 Billboard shifts","description":"Promotion to site","target":"internal","photo":{"id":456272256,"album_id":-27,"owner_id":2000057564,"sizes":[{"type":"l","url":"https:\/\/pp.userapi.com\/c848636\/v848636352\/1b0f54\/x8ryZVy8I5Y.jpg","width":537,"height":240},{"type":"m","url":"https:\/\/pp.userapi.com\/c848636\/v848636352\/1b0f51\/7KaH1cYospI.jpg","width":130,"height":87},{"type":"p","url":"https:\/\/pp.userapi.com\/c848636\/v848636352\/1b0f53\/EvFHZOrRx0w.jpg","width":260,"height":173},{"type":"s","url":"https:\/\/pp.userapi.com\/c848636\/v848636352\/1b0f50\/qO40_HEhJTM.jpg","width":75,"height":50},{"type":"x","url":"https:\/\/pp.userapi.com\/c84863
In the normal form:
{ 
 "response":{ 
 "items":[ 
 { 
"id":1397,
"date":1559977207,
"owner_id":-56279925,
"from_id":-56279925,
"post_type":"post",
 "text":"\"Java entry!\" - #camp on programming in #Java for students aged 12 to 17 in Kazan. \n\Organizatory the Higher school of ITIS KFU and the Center for Children's Intellectual Development \"Brain storm\". Classes are held from Monday to Friday at Kazan Federal University.\n\Padres venue: Kazan, Professora nuzhina, 2 (KSK KFU\"UNIX\", the coworking of the Higher school of ITIS). Participants will learn the basics of Java development, write your web app and will work in a team. Particular emphasis is placed on learning object-oriented programming in Java.\n\after lunch, the guys are waiting for games, quests, tours of the city. Schedule of classes:\n - 09:00 - 12:00 - classes :Programming Java;\n - 12:00 - 13:00 - lunch\n - 13:00 - 17:00 - games, quests, a tour of the it Park, excursions to museums of Kazan Federal University.\n\NIN the cost of changing the included 2 meals a day. Read more: +7 900 324 32 60 and https:\/\/www.kidsreview.ru\/world\/catalog\/camps\/java-shturm-lager-po-programmirovaniyu-na-java-dlya-shkolnikov-12-17-let-v-kazani",
"marked_as_ads":0,
 "attachments":[ ],
 "post_source":{ 
"type":"vk"
},
 "comments":{ },
 "likes":{ },
 "reposts":{ },
 "views":{ }
},
 { 
"id":254017,
"date":1559973606,
"owner_id":-54530371,
"from_id":-54530371,
"post_type":"post",
 "text":"5 features of the Java language, you should be aware of \n \on some features of the Java language often do not know themselves cavity. Talk about 5 the features of this language that everyone should know: https:\/\/proglib.io\/p\/java-hidden-secrets\/\n\n#java@proglib",
"marked_as_ads":0,
 "attachments":[ ],
 "post_source":{ },
 "comments":{ },
 "likes":{ },
 "reposts":{ },
 "views":{ }
},
 {

There is a list in the List owner_id owner1 = new List();
I have this json which is recorded in the responseString to remove a group of elements:
{ 
"id":254017,
"date":1559973606,
"owner_id":-54530371,
"from_id":-54530371,
"post_type":"post",
 "text":"5 features of the Java language, you should be aware of \n \on some features of the Java language often do not know themselves cavity. Talk about 5 the features of this language that everyone should know: https:\/\/proglib.io\/p\/java-hidden-secrets\/\n\n#java@proglib",
"marked_as_ads":0,
 "attachments":[ ],
 "post_source":{ },
 "comments":{ },
 "likes":{ },
 "reposts":{ },
 "views":{ }
 },

which is NOT equal owner_id owner_id owner_id in the list in List owner1 = new List();
March 23rd 20 at 19:36
1 answer
March 23rd 20 at 19:38
Solution
List<int> owner1 = new List<int>();
owner1.Add(-54530371);
var json = // deserialize json strings into an object
var resultItems = json.Response.Items.Where(t => !owner1.Any(o => o == t.Owner_Id));


try.
var json = // deserialize json strings into an object
this is due to the json which is recorded in the responseString? - Rylan.Bogisich commented on March 23rd 20 at 19:41
@Rylan.Bogisich, well this whole piece of writing a string - it needs to go here

var json = JsonConvert.Deserialize<MyResponseClass>("json footcloth");
- lenore.Tow commented on March 23rd 20 at 19:44
Thank you!
dynamic vkData1 = JsonConvert.DeserializeObject(responseString);
var vk1 = vkData1.response;
var resultItems = vkData1.response.items.Where(t => !owner1.Any(t.Owner_Id));

here is the code but I have error
cannot use a lambda expression as the argument to dynamically send transactions without prior conversion to the delegate type or expression tree
- Rylan.Bogisich commented on March 23rd 20 at 19:47
@Rylan.Bogisich, 1. don't use dinamic. do mapping in DTO object class.
2. ".Any(t.Owner_Id)" -> ".Any(o => o == t.Owner_Id)" - lenore.Tow commented on March 23rd 20 at 19:50

Find more questions by tags C#JSON