I’ve been using VB.NET for about a year now (I was exclusively a C# developer before that) and one thing that always annoyed me was not being able to initialize my lists at the time that I declared them, the way I could in C#. They added this functionality in VB 10, so this is how you do it:
Dim customers As New List(Of String) From {"Tom", "Bob", "John", "Lisa"}
Anonymous
Hi There – Can you let me know what myType refers to?
Thanx
marcus.leedham@yaoo.co.uk
Esteban Garcia
Hello Marcus,
In this case, myType would be whatever LINQ to SQL type you the predicate is acting on . So if you have a table called Product that you want to apply the dymanic logic to, that line would read:
Dim predicate = PredicateBuilder.False(Of Product)()
I hope that helps!