I am working on a model that has a list within it.
I need to flatten the list into the main object that is a JSON file.
So this is what I need to flatten it as: Example:
{
name: Test1
startDate: 6/6/2020
endDate: 6/7/2020
assetId: 8
locationId: 10
}
The C# class model is like this:
public string name { get; set; }
public DateTime startDate { get; set; }
public DateTime endDate { get; set; }
public List<Resources> ResourcesList { get; set; }
This would the class Resources:
public string Type { get; set; }
public int Id { get; set; }
Then the values for Sources would be this:
new Resources { Type = "assetId", Id = 8 }
new Resources { Type = "locationId", Id = 10 }