My URL is formatted as:
workareaRefs=1&workareaRefs=2&workareaRefs=3&jurisdictions=1&jurisdictions=2&jurisdictions=4&tags=1&tags=2
etc etc. How can I store all these values as 3 separate arrays as objects? I will be using them to filter in a query. The below method is written incorrectly. Not sure how to go about this.
Thanks
public (string[] workareaRefs, string[] jurisdictions, string[] tags) FiltersQS(NameValueCollection parameters)
{
var workAreaRefs = new List<string>();
var jurisdictions = new List<string>();
var tags = new List<string>();
if (WorkAreas.Count == 0 && workAreaRefs.Count == 0)
{
foreach (var workAreaRef in parameters["workarearef"])
{
workAreaRefs.Add(workAreaRef);
}
}
if (Jurisdictions.Count == 0 && jurisdictions.Count == 0 )
{
foreach (var jurisdiction in parameters["jurisdictionref"])
{
workAreaRefs.Add(jurisdiction);
}
}
if (Tags.Count == 0 && tags.Count == 0)
{
foreach (var tags in parameters["tags"])
{
tags.Add();
}
}
return (workAreaRefs, jurisdictions, tags);
}