VB.NET equivalent to this C# code?
ctx.Load(site,
x => x.Lists.Where(l => l.Title != null));
I've tried
ctx.Load(site, Function(x) x.Lists.Where(Function(l) l.Title IsNot Nothing))
but this errors with "The expression (Convert(l.Title) != null) is not supported."
Thoughts
if Title is string try use IsNullOrEmpty();
or
Nullable(Of T).HasValue if Title is Nullable
or
Sub Main()
Dim list As New List(Of A)
Dim a1 As New A
a1.Title = "sqws"
Dim a2 As New A
a2.Title = Nothing
list.Add(a1)
list.Add(a2)
Dim q = From c In list Where c.Title IsNot Nothing
End Sub
Public Class A
Dim t As String
Public Property Title() As String
Get
Title = t
End Get
Set(ByVal value As String)
t = value
End Set
End Property
End Class
This may be cheating, but I have used Reflector in the past to decompile my C# code and then display it as other .NET languages just to see how they would look as I am most fluent in C#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With