-
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
Allow using unmapped properties getters in queries #2886
Comments
@joecarl Thanks for sharing your thoughts. Any contributions are welcome. Feel free to share the PR. By the way, it looks like to design/implement the $compute feature. For example: [Computed]
public decimal TotalKg { get => PlasticKg + OthersKg; } Here's our proposal:
Any thoughts? |
@xuzhg Thankyou very much for your answer. Also, about the |
I've been attempting to implement this, but I've encountered a significant obstacle. The getter method's body cannot be translated at runtime because it is a compiled method, unlike Does anybody know how to face this problem? Any help is appreciated |
Imagine the following scenario:
So my proposal is:
NotMappedAttribute
class.getter
and theNotMapped
attribute, then the getter definition should be used as part of the query instead of using the property name.NotMappedAttribute
should prevent the materializer from setting that property in all cases, it also should throw exception if the property is used in a query and it doesn't have a customgetter
.I could implement this myself and submit a pull request, but I would like to receive some feedback before proceding. Thanks
The text was updated successfully, but these errors were encountered: