0

I have these objects

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 

I can have more Type-s with their Speclimits values. I need to find the maximum of MaxValue. I can make it with a for each to check every time which number is bigger, but I thought maybe their is some linq with what this could be achievable. I found something like this in 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(); 

but I can't translate it to vb.net Any help is appreciated!

0

1 Answer 1

1

I guess you want something like this:

Dim minValue As Double = list.Min(Function(x) x.SpecLimits.MinValue) Dim maxValue As Double = list.Max(Function(x) x.SpecLimits.MaxValue) 
Sign up to request clarification or add additional context in comments.

1 Comment

Yes, this is what I need. Thank you. It works as I expected.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.