I have a table in database with a primary key say emp_pk. Now using LINQ I am trying to perform some operations on it. When I change few properties and call,

context.SubmitChanges();

ideally the where clause should contain where emp_pk = value.

But when I review the query from SQL profiler, I see lot of conditions in where clause, which I believe are generated by LINQ engine. This is causing a major performance issue.

Can anyone please help me in this case to optimize the query?

有帮助吗?

解决方案

That's because optimistic concurrency check is enabled. You can turn it off per column by setting Update Check=never per column in the dbml designer

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top