Is it possible to add a where clause to update through objectcontext?

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
KW
Posts: 123
Joined: Tue 19 Feb 2008 19:12

Is it possible to add a where clause to update through objectcontext?

Post by KW » Wed 29 Mar 2017 00:57

Is it possible to add a where clause to objects updated through objectcontext?

var _Customer = this.objectcontext.Customers.where(x=>x.CustomerID == 1).First();

_Customer.FirstName = "Dan";

_Customer.AddWhereOnUpdateCondition('FirstName' != 'Dan' );

_objectcontext.SaveChanges();

Here is what I'm looking for:

https://weblogs.asp.net/pwelter34/entit ... re-queries

Would these extension methods work with your provider for MySQL?

Sql executed would look like:

Update Customer set FirstName = 'Dan' where FirstName != 'Dan' //0 rows affected

Shalex
Devart Team
Posts: 8033
Joined: Thu 14 Aug 2008 12:44

Re: Is it possible to add a where clause to update through objectcontext?

Post by Shalex » Fri 31 Mar 2017 15:19

KW wrote:Here is what I'm looking for:

https://weblogs.asp.net/pwelter34/entit ... re-queries

Would these extension methods work with your provider for MySQL?
We do not test third-party extensions. Please contact the extension vendor to find out if it was designed for Devart EF providers as well.

KW
Posts: 123
Joined: Tue 19 Feb 2008 19:12

Re: Is it possible to add a where clause to update through objectcontext?

Post by KW » Wed 05 Apr 2017 18:58

This is not something that is currently supported correct?

Shalex
Devart Team
Posts: 8033
Joined: Thu 14 Aug 2008 12:44

Re: Is it possible to add a where clause to update through objectcontext?

Post by Shalex » Fri 07 Apr 2017 11:11

We can't tell this for sure. Please contact the extension vendor to find out if it was designed for Devart EF providers as well.

Post Reply