Reputation: 363
I am trying to convert this to vb.net via the developerfusion conversion tool but dosent work..
using System.Linq;
List<A> foo = GetFooList(); // gets data
List<A> fooBorItems = foo.Where(a = > a.FName == "foobar").ToList();
Plz can someone convert this to vb.net form e and tell me whats this --> =>
Upvotes: 0
Views: 79
Reputation: 14470
Try
Dim fooBorItems as List(Of A) = foo.Where(Function(a) a.Name = "foobar").ToList()
Also please have a look at the article about linq samples
Upvotes: 1
Reputation: 37543
It's a predicate delegate used in an extension method. Here is the MSDN article that describes its usage:
http://msdn.microsoft.com/en-us/library/bfcke1bz.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2
The appropriate usage in VB for what you've pasted would be:
Dim fooBorItems as List(Of A) = foo.Where(Function(x) x.FName = "foobar").ToList()
Upvotes: 2