Reputation: 557
i want to convert Dictionary into Json. the key is a string and the value is a ICollection of CompaignModel :
IDictionary<string, ICollection<BuzzCompaignModel>> BuzzCompaignByInterest ;
and here is what contain BuzzCompaign Model :
public class BuzzCompaignModel
{
public long BuzzCompaignId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public DateTime EndDate { get; set; }
}
how can i convert BuzzCompaignByInterest into JSON
Upvotes: 3
Views: 2404
Reputation: 8091
Use Json.NET and JsonConvert
http://james.newtonking.com/projects/json/help/SerializingJSON.html
It doesn't matter dictionary or object are serialising to Json
Upvotes: 3