-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OriginalNameAttribute not being captured when DataServiceQuery<T> is casted to DataServiceQuery<InterfaceT> #2856
Comments
Hello @joecarl, this sounds like a feature request. Curious, does adding the |
Yes, adding the attribute to the interface properties "fixes" the issue. Unfortunately I cannot rely on this approach because I have multiple implementations for the same model, one for Sql db, another for OData endpoints and I will eventually have even more implementations for other OData endpoints where properties names may also be different. I already fixed this myself though and uploaded a PR #2862, did you have time to review it? (It's just one line of code) |
@joecarl I'm also curious whether adding the With respect to your pull request, the one line change is not enough. Tests are necessary taking into consideration the following scenarios:
|
@gathogojr Yes, adding the I added tests regarding all the commented scenarios. Also, I found another related issue. It happens only when OrderBy is used:
I made another one line code change that fixes the issue, but this time I'm not sure wether It's 100% appropiate or not. protected override QueryableResourceExpression CreateCloneWithNewTypes(Type newType, Type newResourceType) Please have a look at the PR. Thanks! |
I'm getting the error described in the title when trying to resolve an OData query.
Assemblies affected
Microsoft.OData.Client 7.20.0
NetFramework 4.6.1
Reproduce steps
Expected result
No exception should be thrown and the query should be built using the object's original type attributtes.
Actual result
An exception is being thrown showing the following OData service error response:
The text was updated successfully, but these errors were encountered: