This question is locked. New answers and comments are not allowed.
Hi there,
I've the following classes - using Entity Framework 4.
* Partner
- Name
- Email
- ...
- Address (following Class)
* Address
- Street
- City
- ...
- Country (following Class)
* Country
- Name
- Currency
- ...
A Partner can have multiple Addresses, an Address can only have one Country.
Now I want to display the following properties:
Partner.Name
Partner.Address.Street
Partner.Address.City
Partner.Address.Country.Name
It works perfectly fine except for displaying Partner.Address.Country.Name. I always get the following exception:
"Unable to cast object of type 'System.Linq.Expressions.MethodCallExpressionN' to type 'System.Linq.Expressions.ParameterExpression'."
If I try to output Partner.Address.Country, I get the property names and values as an output. I also see the "Name" property with my intellisense. It just doesn't run through the output.
That's my code:
Any ideas? Thanks in advance.
I've the following classes - using Entity Framework 4.
* Partner
- Name
- ...
- Address (following Class)
* Address
- Street
- City
- ...
- Country (following Class)
* Country
- Name
- Currency
- ...
A Partner can have multiple Addresses, an Address can only have one Country.
Now I want to display the following properties:
Partner.Name
Partner.Address.Street
Partner.Address.City
Partner.Address.Country.Name
It works perfectly fine except for displaying Partner.Address.Country.Name. I always get the following exception:
"Unable to cast object of type 'System.Linq.Expressions.MethodCallExpressionN' to type 'System.Linq.Expressions.ParameterExpression'."
If I try to output Partner.Address.Country, I get the property names and values as an output. I also see the "Name" property with my intellisense. It just doesn't run through the output.
That's my code:
Any ideas? Thanks in advance.