-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
DbFunctions: instance functions on entities #9811
Comments
@pmiddleton Let us know if you're interested in working on this. |
Yes |
Please also consider an scenario like the following: I need to efficiently check some information that is encrypted by a symmetric key in the database, across several tables. It would be nice if we could do something like
You don't always need to execute the function over an specific Entity. Thanks |
@regul4rj0hn - Is email bound to an entity in your example? If so then you can already do that today. If email is just a string coming in from the application then you can't. Support for use case is included in #11129 but that is on hold pending the query redesign in 3.0 |
Yeah, it's coming from the app that's the issue. Currently calling the scalar function the old-fashioned way as a work around. I guess that refactor will have to wait then. Thanks for the help, @pmiddleton ! |
Consider the scenario originally described at #9213 (comment) (about why instance functions on
DbContext
can be compelling):It could actually be even more compelling to be able to do this:
This could work for instance methods, computed properties or even extension method defined over the entity type.
It would be convenient for the translation to automatically map the "this" entity instance to the key of the entity when invoking the database implementation of the function.
The text was updated successfully, but these errors were encountered: