I'm trying to output data like this:
[[...],[...],[...],[...]]
But my query gives me this result:
[{...},{...},{...},{...}]
Here is my query:
var result = (from c in displayedCompanies
group c by new { c.CodigoDeVenta } into s
select new{
ID = Convert.ToString(i++),
s.Key.CodigoDeVenta,
TotalInv = s.Sum(x => x.Inventario)
}).ToArray();
I've tried some options like the following but it's wrong:
var result = (from c in displayedCompanies
group c by new { c.CodigoDeVenta } into s
select new [] {
ID = Convert.ToString(i++),
s.Key.CodigoDeVenta,
TotalInv = s.Sum(x => x.Inventario)
}).ToArray();
Note that the diference is the [] in select new []. I used to have a query before I implemented the "group by" that worked correctly, but after I added the group by this does not work anymore.
Thanks!
select new List<object>(){Convert.ToString(i++),s.Key.CodigoDeVenta,s.Sum(x => x.Inventario)}