Can you do calculations from a column in an array in Blazor

Viewed 27

I have 2 tables, Sales and FutureSales that I would like to perform calculations on. The FutureSales table holds multiple columns but has a column called percentage which I would like to multiply by a column in my main table(Sales) called price. I have tried to create an array of FutureSales but I am confused how the calculation will sift through the array to find the percentage column. I am utterly confused

here is my calculation:

@code{
            var percentagearray = futuresales.ToArray();
            context.January= (context.Price)*percentagelist[0];
            context.February= (context.Price)*percentagelist[1];
            context.March= (context.Price)*percentagelist[2];
}

Is there anything I am missing from this calculation?

0 Answers
Related