adworldmedia
asked on
Create a StringDictionary Class
I want to be able to create a class type with a StringDictionary as one of the members.
Where I can add multiple patterns into the class, which eventually I'll convert into a JSON object that looks like:
using the NewtonSoft.Json library...
public class Filter
{
public string type = "criterion_filter";
public NameValueCollection patterns;
public AdultFilter(string Type, NameValueCollection Patterns)
{
this.type = Type;
NameValueCollection patterns = new NameValueCollection();
patterns.Add(Patterns);
}
}
Where I can add multiple patterns into the class, which eventually I'll convert into a JSON object that looks like:
“patterns” : {
“sex” : [ “s”, “e” ],
“nin” : [“a”],
“shoes” : [“f”],
“run” : [“e”]
}
using the NewtonSoft.Json library...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://msdn.microsoft.com/en-us/library/system.collections.specialized.stringdictionary.aspx
But I think this is not a problem. What is? From your question I could not understand what are key and what are values, etc. Could you elaborate your question in more details?