I want to create like this:
[
['date', 'T1', 'T2', 'T3'],
['2000', 1, 1, 0.5],
['2001', 2, 0.5, 1],
['2002', 4, 1, 0.5],
['2003', 8, 0.5, 1],
['2004', 7, 1, 0.5]
]
from my model
public partial class AylikOkumaIstatistik
{
public string sno { get; set; }
public string date{ get; set; }
public Nullable<decimal> TotalUsageValue { get; set; }
public string UsageType { get; set; } // T1,T2,T3
}
This is possible with using json? If it is possible, is there any code example or tutorial about this topic.How can I convert data that is from database to json?
Thanks.
Of course, you could use the
object[]type as view model (where each element is itself anobject[]):As far as converting the data that is in your database to this view model is concerned, well, you will have to give an example of how is your data represented in the database. Ideally provide a hardcoded example of how your model will look like. But it will be a simple matter of projecting your domain model to an
object[].