I have a model with a field that has a member variable referencing the same class. Now I want to query the data and its child items but I only want to output certain members and filter the others.
Example model:
public class ContentModel
{
public string Name;
public string Url;
public string x, y, z // filter this
public IEnumerable<ContentModel> Children;
}
Expected output:
{
"Name": "",
"Url": "",
"Child": {
"Name": "",
"Url": "",
"Child": {
"Name": "",
"Url": ""
}
}
}