What I need is to get the GroupAssets SearchPath value by matching the Name value to a value from a database query. At this point I am just trying to pull the GroupAssets into an array.
appsettings.json
"Production": {
"PrintJobs": [
{
"SalesCategory": "5084",
"JobType": 1,
"SubJobType": 5014,
"ShipVia": 5019,
"CSR": 360,
"SLAHours": 216,
"DaysToArrive": 5,
"Note": [ "" ],
"GroupAssets": [
{
"Name": "MapImage",
"SearchPath": "\\\\Server\\Path",
"PrintAssetType": "Image",
"ValidExtensions": [ "jpg" ]
},
{
"Name": "PageImage",
"SearchPath": "\\\\Server\\Path",
"PrintAssetType": "Image",
"ValidExtensions": [ "jpg" ],
"CreativeCodes": [ "M1YV", "M1YW" ]
},
{
"Name": "ItineraryPage",
"SearchPath": "\\\\Server\\Path",
"PrintAssetType": "Pdf",
"ValidExtensions": [ "pdf" ],
"CreativeCodes": [ "M1YV", "M1YW" ]
}
],
}
}
My code:
var myArray = _config.GetSection("Production:PrintJobs").GetChildren();
public class PrintAssetDefns
{
public string Name { get; set; }
public string SearchPath { get; set; }
public string PrintAssetType { get; set; }
public string ValidExtensions { get; set; }
public string CreativeCodes { get; set; }
}