Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit ffd434a

Browse files
committed
Merge pull request #204 from jfoshee/patch-1
For UpdateOnly added a multi-field example
2 parents 226d90b + e6804b2 commit ffd434a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ db.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName);
344344
```
345345
**UPDATE "Person" SET "FirstName" = 'JJ'**
346346

347+
```csharp
348+
db.UpdateOnly(new Person { FirstName = "JJ", Age = 12 }, p => new { p.FirstName, p.Age });
349+
```
350+
**UPDATE "Person" SET "FirstName" = 'JJ', "Age" = 12**
351+
347352
When present, the second expression is used as the where filter:
348353
```csharp
349354
db.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName, p => p.LastName == "Hendrix");
@@ -946,4 +951,4 @@ As [performance is the most important feature](https://github.com/mythz/ScalingD
946951
- Fast, supports dynamics and expandos, smart use of optional params to provide a wrist-friendly api, fits in a single class. Multiple RDBMS support. Requires .NET 4.
947952
* **[Simple.Data](https://github.com/markrendle/Simple.Data)** - by [@markrendle](http://twitter.com/markrendle)
948953
- A little slower than above ORMS, most wrist-friendly courtesy of a dynamic API, multiple RDBMS support inc. Mongo DB. Requires .NET 4.
949-
954+

0 commit comments

Comments
 (0)