I am a bit new to WCF and will try to clearly describe what I am trying to do.
I have a WCF webservice that uses JSON requests. I am doing fine sending/receiving JS
Here's an alternative way to read json into dictionary:
[DataContract]
public class Contract
{
[DataMember]
public JsonDictionary Registration { get; set; }
}
[Serializable]
public class JsonDictionary : ISerializable
{
private Dictionary m_entries;
public JsonDictionary()
{
m_entries = new Dictionary();
}
public IEnumerable> Entries
{
get { return m_entries; }
}
protected JsonDictionary(SerializationInfo info, StreamingContext context)
{
m_entries = new Dictionary();
foreach (var entry in info)
{
m_entries.Add(entry.Name, entry.Value);
}
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
foreach (var entry in m_entries)
{
info.AddValue(entry.Key, entry.Value);
}
}
}