Convert code line to VB

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

Could someone, please, convert the following code line to VB.NET?

bool containsValue = myList.Any(item => item.NameParameter ==
nameParameterValue);

(This is .NET 3.5. I couldn't find a converter that does this)

Thanks,
Miguel
 
Hello,

Could someone, please, convert the following code line to VB.NET?

bool containsValue = myList.Any(item => item.NameParameter ==
nameParameterValue);

(This is .NET 3.5. I couldn't find a converter that does this)

Thanks,
Miguel

The => introduces a Lambda expression. I don't hve VB2008 installed
right now so I can't verify this, but I think it is:

Dim containsValue as Boolean = myList.Any( Function(item)
item.NameParameter = nameParameterValue )
 
Miquel,
Jack's answer:

Dim containsValue As Boolean = myList.Any(Function(item)
item.NameParameter = nameParameterValue)

Is correct for the RTM version of VS 2008.
 
Back
Top