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

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

Postby 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/entity-framework-batch-update-and-future-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
KW
 
Posts: 121
Joined: Tue 19 Feb 2008 19:12

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

Postby Shalex » Fri 31 Mar 2017 15:19

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

https://weblogs.asp.net/pwelter34/entity-framework-batch-update-and-future-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.
Shalex
Devart Team
 
Posts: 7616
Joined: Thu 14 Aug 2008 12:44

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

Postby KW » Wed 05 Apr 2017 18:58

This is not something that is currently supported correct?
KW
 
Posts: 121
Joined: Tue 19 Feb 2008 19:12

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

Postby 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.
Shalex
Devart Team
 
Posts: 7616
Joined: Thu 14 Aug 2008 12:44


Return to Entity Framework support