views:

159

answers:

0

The selector expression for LoadProperty must be a MemberAccess for the property.

I'm converting some C# to VB, this is the C# line:

entities.LoadProperty((MyType)MyTargetObject, c => c.MyProperty);

I convert it to VB like so:

entities.LoadProperty(DirectCast(MyTargetObject, MyType), Function(c) c.MyProperty)

However I get the error above. I don't understand what the code is doing, or anything at all, I am simply converting it line by line into Visual Basic. When I run the project, the error I get is the one above.

All I can see is that Entities is a class that inherits ObjectContext, which might mean something.

Any help would be soooo good because I am stressing out big time. Thanks.