Query expression to get maximal item through condition using LINQ

Amatya
Posted by Amatya under C# category on | Points: 40 | Views : 148
Query expression to get maximal item through condition using LINQ

var dnfList = new List<int> { 10, 20, 30, 40 };
int dnfMax = (from dnf in dnfList where dnf < 25 select dnf).Max();


Result
dnfMax 20

Comments or Responses

Login to post response