Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

chaks nag

@chaks nag
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to remove child of a parent from json string based on condition in c# or linq
    C chaks nag

    Yes I trying to remove if parent of child name also same but below solution is not workin. Here is my full code, first converted my c# class list object to json string, and then to JObject.

    var jsonString = JsonConvert.SerializeObject(eligibilityModel);
    JObject jObject = JObject.Parse(jsonString);
    jObject.Descendants()
    .OfType()
    .Where(attr => attr.Name.Contains("ChildProducts") && attr.Parent.Equals("ChildProducts" ))
    .ToList()
    .ForEach(attr => attr.Remove());

    LINQ csharp linq json help tutorial

  • how to remove child of a parent from json string based on condition in c# or linq
    C chaks nag

    json string have parent and child and child has sub child(grand child). Here wanted to remove grand child. child name and grand child name is same so if i remove based on the name it will remove child and grand child. so if grand child has child as parent then remove grand child. I have converted json string to JObject here my code snippet: i know this is wrong it deletes both child and grand child because names are same. jObject.Descendants() .OfType() .Where(attr => attr.Name.Contains("GrandChildName")) .ToList() .ForEach(attr => attr.Remove());

    LINQ csharp linq json help tutorial

  • how to remove child of a parent from json string based on condition in c# or linq
    C chaks nag

    hi I have a scenario where I wanted to remove children of a parent. here is my json object. I want to remove the last CP not parent of CP. appreciate your help.

    Object
    ->Address
    ->PRule
    ->0
    ->RuleP
    ->CP
    ->0
    ->CP

    LINQ csharp linq json help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups