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

Updating with Where extension method #104

Open
catinodeh opened this issue Nov 16, 2016 · 1 comment
Open

Updating with Where extension method #104

catinodeh opened this issue Nov 16, 2016 · 1 comment

Comments

@catinodeh
Copy link

This code...

EFBatchOperation.For(_repo, _repo.CityServices)
.Where(cs => cs.serviceid == serviceid && citiesInThisFieldOffice.Contains(cs.cityid) && cs.status)
.Update(x => x.updatedby, x => userId);

..generated this update...

exec sp_executesql N'UPDATE [dbo].[cityservices] SET [updatedby] = @p__linq__0 WHERE ([serviceid] = @p__linq__0) AND ([cityid] IN (6688, 4934, 2215, 2302, 2210, 6725, 6749, 7217, 7241, 7329, 3959, 5615, 7405, 7406, 7412, 7414, 7417, 7425, 7432, 7443, 7444, 7448, 7449, 7450, 7452, 7456, 7463, 7464, 7465, 7471, 7473, 7476, 6946, 7389, 7142, 4519, 2231, 16756, 6763, 7256, 6719, 6371)) AND ([status] = 1)',N'@p__linq__0 int,@p__linq__0 int',@p__linq__0=531,@p__linq__0=711
go

System.Data.SqlClient.SqlException (0x80131904): The variable name '@p__linq__0' has already been declared. Variable names must be unique within a query batch or stored procedure.

The problem is that EFUtilities declared the same variable twice.

I'm using the latest release (1.0.2.0).

@ShurikEv
Copy link

How you fix it?

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