I am creating a report which requires returning Lists, and Json data to a web page. I'm working with a multi-tiered application. The web project is created using MVC but the heavy lifting is done in class libraries in separate projects.
I am returning a report object to my controller from a class library but I wanted to know is it possible to return a mix of Lists and Json in the model? Ideally I would like the report model to be similar to the following:
public class Report
{
public List<TopSellers> TopSellers { get; set; }
public List<MonthlySales> MonthlySales { get; set; }
public Json ShopSales { get; set; }
}
This way, the list stuff can be rendered as normal, but the jQuery could grab the Json being return to render the graphs I'm using.
Is this possible?
I have tried to declare it similar to this however the only option I get is 'JsonReaderWriterFactory'.
My exposure of Json up until now has been null so if someone could help me out, or point me in the right direction I'd be very grateful!
Thanks.