Skip to content
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

Support for EF.Property (shadow properties) #65

Open
Xriuk opened this issue Nov 9, 2022 · 1 comment
Open

Support for EF.Property (shadow properties) #65

Xriuk opened this issue Nov 9, 2022 · 1 comment

Comments

@Xriuk
Copy link

Xriuk commented Nov 9, 2022

At the moment EF.Property is not supported.
I tried adding it as an IMethodCallVisitor but it gives me an error:

Expression of type System.Linq.Expressions.TypedParameterExpression is not supported

I guess it's because of the first argument which is the instance of the entity.

I'm using it as argumentSelectors parameter in ExecuteRawSql with something like that:

modelBuilder.Entity<Brand>().InsteadOfDelete(a => a.Action(a => a.ExecuteRawSql("... = {0}", b => EF.Property<int>(b, "MyId"))));

but it think it should be the same in other expressions.

I would need this feature to allow triggers to target a shadow property (which is mapped to a column) of the entity, my question is: how can I replace this condition correctly?
So that it gets added to the list of columns which get fetched into the cursor, and generates the correct SQL.
I don't think IMethodCallVisitor is the most appropriate method at this point.

From a quick look at the code (specially the TriggerVisitor) I see that for each visited member should be declared on the entity, right?

@max-kuzmin
Copy link

I stuck with this problem too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants