I'm pretty new to MVC and have some problem with Linq, I think the solution would be pretty simple.
I have a table in a database with the following variables;
Name - string
Value - float
Time- Datetime
Now i want to make a specific name into two arrays, one containing the Values and the other one the Time so it will be easy to plot. I have made a controller where i have manage to access the database and get the specific name out with this code;
var Names = db.Graphs
.Where(r => r.Name.Contains(Name) ||
string.IsNullOrEmpty(Name))
.Take(10)
But im completely stuck on how to itterate through the database, get two arrays and send it to the View where i have my Highchart-plot.
Javascript;
series: [{
name: 'NameOn',
data: [23.3, 18.3, 13.9, 9.6] <--- Where i want to insert my data
}]
Any idea on how to retrieve the data?