-
Notifications
You must be signed in to change notification settings - Fork 475
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
Dynamic properties with DerivesFrom is not working #2747
Comments
@komdil Thanks for reporting the issue. I'm investigating what could be going wrong when |
You are right. I am using DerivesFrom for making workarounds with my base interface. I have an interface:
This is a base interface of all classes. As you know OData does not support interfaces. I have a lot of places that I am using navigation property with that interface type. For example, SuperEntity property in my Laptop class. I am configuring all my classes with DerivesFrom and base class derives from this interface:
Then I can do $expand for this property. When I don;t use DerivesFrom it will show me exception:
Is there any difference between resolving inheritance by the model builder and by DerivesFrom? Should they work with the same behavior? |
I am having problem with a dynamic properties. It looks like it is not working with multiple inheritance. OData is not seeing dynamic properties from the base class.
Assemblies affected
Microsoft.AspNetCore.OData 8.0.11
Reproduce steps
Currently my model classes looks like this:
And my configuration:
I am sending request for 3 routes:
https://localhost:7258/api/odata/productbase?$select=MySuperProperty
https://localhost:7258/api/odata/product?$select=MySuperProperty
https://localhost:7258/api/odata/laptop?$select=MySuperProperty
Expected result
I think it should work
Actual result
I am getting error: Could not find a property named 'MySuperProperty' on type [MyType]
The text was updated successfully, but these errors were encountered: