Get Max value from List

后端 未结 8 429
猫巷女王i
猫巷女王i 2021-02-02 05:08

I have List List, my type contains Age and RandomID

Now I want to find the maximum age from this list.

What

8条回答
  •  太阳男子
    2021-02-02 05:41

    int max = myList.Max(r => r.Age);
    

    http://msdn.microsoft.com/en-us/library/system.linq.enumerable.max.aspx

提交回复
热议问题