Bulk update throws exception if I use Take in my query
This code works perfectly
var ems = db.Email.Where(o=>o.Email1.StartsWith("ab")); ems.UpdateFromQuery(x => new Email { stat =x.stat+1 });
but if I add .Take(10) after StartsWith, I get
System.Data.SqlClient.SqlException: 'Incorrect syntax near the keyword 'TOP'.'
Hello @HolyOne ,
Thank you for reporting,
I will check it today or later this week to see what's the SQL generated and if there is something we can do or not about it.
Best Regards,
Jonathan
Hello @HolyOne ,
The issue has been fixed, it will be part of the next release (later this night or tomorrow).
Best Regards,
Jonathan
Hello @HolyOne ,
The v1.7.7 has been released
Take should now be compatible with Batch Update
Let me know if everything is working as expected.
Best Regards,
Jonathan
Hello @HolyOne ,
We will close this issue since it should be solved.
Help us to keep this library free: Donate
Hi @JonathanMagnan, I got exception like this.
Version: Z.EntityFramework.Plus.EFCore 1.8.10 Command: Abc.Where(e => e.Id == id).UpdateAsync(e => new Abc{count = e.count + newCount}) Exception: Must declare the scalar variable "@__Value_1". Incorrect syntax near the keyword 'AS'
Please have a look. Thanks.
Hello @phucdat1d ,
Do you think you could provide a project sample with this issue?
It will help my developer investigate the issue more efficiently.
We now always ask for a project sample even if the issue is easy to reproduce. As a free product, we must find some way to save time to offer an overall better experience for everyone and release fixes faster.
You can send it to: [email protected] if you need to keep the source private
Best Regards,
Jonathan
Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework Extensions • Entity Framework Classic • Bulk Operations • Dapper Plus • LinqToSql Plus
Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function • SQL Eval Function