I'm sending json format and I would like to ask if it's possible to remove a sublist from a list. I have models like these.
public class lineItems
{
public string item_name { get; set; }
public int quantity { get; set; }
public string price { get; set; }
public List<subItem> subItem { get; set; }
}
public class subItem
{
public string sub_item_name { get; set; }
public int quantity { get; set; }
}
The json looks like this. What i'm trying to do is remove the subItem from the second item. I tried to make the subItem null but it still displays in the json format with "subItem": [].
https://i.stack.imgur.com/4Tlim.png
Thank you.