Page 1 of 1

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

Posted: Wed 29 Mar 2017 00:57
by KW
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

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

Posted: Fri 31 Mar 2017 15:19
by Shalex
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.

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

Posted: Wed 05 Apr 2017 18:58
by KW
This is not something that is currently supported correct?

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

Posted: Fri 07 Apr 2017 11:11
by Shalex
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.