我有這些物品
Public Class Class1
Public Property Type As String
Public Property SpecLimits As Limits
End Class
Public Class Limits
Public Property MinValue As Double?
Public Property MaxValue As Double?
End Class
我可以有更多Type的 -s 與他們的Speclimits價值觀。我需要找到 MaxValue 的最大值。我可以for each每次都檢查哪個數字更大,但我認為他們可能是一些linq可以實作的。我在c#
var maxItem = emplist
.Select((emp, index) => new
{
maxProject = emp.project
.Select((proj, pIndex) => new{ proj, pIndex })
.OrderByDescending(x => x.proj.ID)
.First(),
emp, index
})
.OrderByDescending(x => x.maxProject.proj.ID)
.First();
但我無法將其翻譯成vb.net
任何幫助表示贊賞!
uj5u.com熱心網友回復:
我猜你想要這樣的東西:
Dim minValue As Double = list.Min(Function(x) x.SpecLimits.MinValue)
Dim maxValue As Double = list.Max(Function(x) x.SpecLimits.MaxValue)
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/467647.html
