You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was attempting to do an update as described in the docs:
var db = new MightyOrm(connectionString, "Person", "PersonID");
var p = db.Single(42); // get from Person table by primary key
p.LoyalCustomer = true;
db.Update(p);
But I got this error: Cannot complete UPDATE operation, you must provide a WHERE value (specify 1=1 to affect all rows)
Looking at the Update methods, there seems to be no parameter for where .
Digging further into the Issues here lead me to this closed issue about UpdateUsing which seems to work.
Could the documentation be updated to specify using UpdateUsing instead of just Update as this does not seem to work?
The text was updated successfully, but these errors were encountered:
UpdateUsing is what you should be using if you want to specify a where clause but the example you show shouldn't need a where clause: the object has a primary key and the instance of MightyOrm knows which the primary key field is.
The only thing I can think of is, are you sure you have the equivalent of , "PersonID"); in your own code? If not, Mighty won't know what the PK is and so it may be giving that (misleading) error message because of that.
Let me know about that, and I'll try to make some time to look into it some more ... if it is what I am suggesting, then I should probably figure out a way to specify that providing a primary key field would also have solved the problem, in those cases where it would (which IIRC unfortunately isn't all of the cases where that error message can show up!).
I was attempting to do an update as described in the docs:
But I got this error:
Cannot complete UPDATE operation, you must provide a WHERE value (specify 1=1 to affect all rows)
Looking at the Update methods, there seems to be no parameter for
where
.Digging further into the Issues here lead me to this closed issue about
UpdateUsing
which seems to work.Could the documentation be updated to specify using
UpdateUsing
instead of justUpdate
as this does not seem to work?The text was updated successfully, but these errors were encountered: