Home > Net >  C # JSON recursive search the specified object
C # JSON recursive search the specified object

Time:09-17

This is my JSON structure point I

This is the class map

Public class SiteNode
{
Public string url;
Public string [] param;
Public string serviceid;
Public bool is_enabled;
Public string icon;
Public string nodetype;
Public string API.
Public NodeMeta meta.
Public class NodeMeta
{
Public bool is_module_legal;
Public string module;
Public string func.
Public MuiText title;
Public MuiText desc;
Public string group;
Public List Granted_roles;
}
Public class MuiText
{
Public string tw.
Public string gb;
Public string en;
}
Public List The children;
}

Requirements: find JSON serviceid=="System - 016" inside the object, the but this object node with the add/remove users, will change the structure, maybe not in children [] , can provide a recursive method to find the specified object? Thanks to the great god

CodePudding user response:

Your serviceid is the root node of the attribute.

You put the collection deserialized into List And then find (d=& gt; D.s erviceid=="System - 016)" not finished?
  •  Tags:  
  • C#
  • Related