-
Notifications
You must be signed in to change notification settings - Fork 55
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
Problems run - Entity Framework Extensions - UpdateFromQuery - Update From Joined Table #603
Comments
Hello @JaimeCastellanosM , See the following online example I created from your example: https://dotnetfiddle.net/oT5OlX var joined = from o in context.Orders
join c in context.Customers on o.SecondaryID equals c.SecondaryID
select new Order { OrderID = o.OrderID, CustomerID = c.CustomerID };
joined.UpdateFromQuery(x => new Order { CustomerID = x.CustomerID }, options => {
options.Executing = command => {
sb.AppendLine(command.CommandText);
};
}); I had to change some parts of the code as you mixed a lot of EF6 code with EF Core code. Let me know if that correctly answers your question. Best Regards, Jon |
Hello @JonathanMagnan, Thank you for your answer! I tried changing my code like this example, But now I have the next error. this is the query generated in QueryUpdateFromQuery:
The unique differences is that in my query EF put the nickname in the columns (As Rowid), but I dont know if this is a problem. Thank you for your help! |
Hello @JaimeCastellanosM , Indeed, it doesn't work if the column name is different. I tried to find a solution but didn't find one either. One way to fix it since you already access the command is doing a I asked my developer to look at it and see if there is something we can do. Best Regards, Jon |
Hello @JonathanMagnan, I'm Jaime's co-worker. The partial solution works, we're gonna use it while your team try to fix it, this is our example: Those are the generated queries: |
Hello @JonathanMagnan, the method MergeFromQuery could be included in ur roadmap? |
Hello @LeinerViloria , Unfortunately, adding However, I'm opening a reminder on our side to look at it in 1 month to evaluate at least the time and effort, and I will give you an update. Best Regards, Jon |
Hi @JonathanMagnan, if u need help, u can contact us, hehehe, thank u @JonathanMagnan, we'll be attentive |
Hi @JonathanMagnan, we found a weird query maked by UpdatedFromQuery for Postgres, it's through INNER JOIN clause. This is the sql server query generated by UpdateFromQuery (edited with .replace): This is the postgres query generated by UpdateFromQuery (without Alias), it doesn't work: This is the edited postgres query, it works: |
Hello @LeinerViloria , Indeed, you are currently overpassing the limit of our library. The way you are currently using it was not initially expected. We perform an I guess we could eventually add a new option as we control the part of this template. Best Regards, Jon |
Description
I was verifing this Example and I tried to run but have problems.
Entity Framework Extensions - UpdateFromQuery - Update From Joined Table by Michel Zehnder
I would like to know how can to use the UpdateFromQuery from joined Tables.
Exception
If you are seeing an exception, include the full exceptions details (message and stack trace).
Fiddle or Project (Optional)
If you are able,
Provide a Fiddle that reproduces the issue: https://dotnetfiddle.net/jQ4moW
Or provide a project/solution that we can run to reproduce the issue.
Otherwise, make sure to include as much information as possible to help our team to reproduce the issue.
Note: More information you provide, faster we can implement a solution.
Further technical details
The text was updated successfully, but these errors were encountered: