How to perform Mathematic Operations using Linq

Goldytech
Posted by Goldytech under LINQ category on | Views : 1928
Linq supports Mathematic Operations like (Sum,Avg,Min,Max) similiar to T-SQL.
In this snippet I show you the same.

private void LinqMathOperations()
{
List<double> dblNos = new List<double>();
dblNos.Add(1000);
dblNos.Add(23848);
dblNos.Add(18457);
dblNos.Add(87474);
dblNos.Add(54784);

dblNos.Sum();
dblNos.Max();
dblNos.Min();
dblNos.Average();


}

Comments or Responses

Login to post response