I have this linq syntax
var jsonData = new
{
total = 1,
page = 1,
records = per.Count(),
rows =
from r in per
select new
{
id = r.id,
cell = new List<string>()
{
SqlFunctions.StringConvert((double) r.id),
r.nombre,
r.mail,
r.documento
}
}
};
The problem is that the value of each list in cell property has random order of items.
Example result:
item 1: id:" 1" string
nombre:"Medina Teto" string
mail: "soyelteto@hotmail.com" string
dni:"DNI 12312322" string
item 2:
dni:"DNI 12312872" string
mail:"elancho@hotmail.com" string
nombre: "Peuchele Ruben" string
id: " 2" string
item 3:
id: " 3" string
nombre: "la momia Blanca" string
mail: "soylamomiabuena@hotmail.com" string
dni: "DNI 45612322" string
The item 2 has first dni and then mail. the other items has first id and then name
why happend this?
The solution: