entity framework, loadproperty not working - The selector expression for LoadProperty must be a Memb
        Posted  
        
            by SLC
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by SLC
        
        
        
        Published on 2010-03-19T16:38:38Z
        Indexed on 
            2010/03/19
            16:41 UTC
        
        
        Read the original article
        Hit count: 527
        
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.
© Stack Overflow or respective owner