-
Notifications
You must be signed in to change notification settings - Fork 30
allow properties to have a setter. closes #77 #79
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
base: master
Are you sure you want to change the base?
Conversation
|
It looks like the tests failed because some properties are getting selected automatically when there's no select statement. Since these properties can have a setter they will get automatically selected by EF when there's no select. For example |
|
I wonder if we can somehow not map any properties with Projectable, for read only properties it's not needed, but for writable properties they need to be marked as Not mapped or ignored by EF. |
I would say we want to select these but based on the projectable expression. I would expect Alias to be computed for me if I queried an Entity without an explicit select clause. |
|
We would essentially want to translate:
This is not a trivial undertaking. If you want to give it a shot then the translation could be performed in protected override Expression VisitExtension(Expression node)
{
if (node is QueryRootExpression)
{
throw new NotImplementedException("Do some magic here to reference projectable properties");
}
return node;
}
`` |
|
#84 Is another example of an expression that could be closed if we were to rewrite QueryRootExpressions |
|
If I understood correctly, |
|
@zoriya No, this would only make it so that all projectable members of the source type will be expanded. A user can still apply additional Select expressions which will essentially cause the rewrite to become a no-op. |
|
I'd be happy if someone wants to take that on, but I don't have time to do that part right now. |
This adds support for properties to have a getter (and setter), closes #77. Like this:
I was able to run a generator test and verify this works, however I kept getting a compile error from the generator on the same code for the functional tests. I'm not sure how to fix that one.