markrendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 303 forks source link

Don't run update if new values equal original #336

Closed pmarflee closed 10 years ago

pmarflee commented 10 years ago

When performing an update with optimistic concurrency, an update query is issued against the database even if the new values do not differ from the old values. The syntax of the query that is generated is not well-formed (empty SET clause) so the update fails.

The implementations of RunStrategy know whether the new value differs from the old value before performing the update. If they do not differ, I propose that no update query is issued against the database and zero is returned for the number of records updated.