@@ -407,23 +407,23 @@ The second argument lets you specify a filter for updates:
407
407
db .UpdateOnly (() => new Person { FirstName = " JJ" }, where : p => p .LastName == " Hendrix" );
408
408
```
409
409
410
- Alternatively you can pass in a POCO directly, in which case the first expression in an ` UpdateOnly `
410
+ Alternatively you can pass in a POCO directly, in which case the first expression in an ` UpdateOnlyFields `
411
411
statement is used to specify which fields should be updated:
412
412
413
413
``` csharp
414
- db .UpdateOnly (new Person { FirstName = " JJ" }, onlyFields : p => p .FirstName );
414
+ db .UpdateOnlyFields (new Person { FirstName = " JJ" }, onlyFields : p => p .FirstName );
415
415
416
- db .UpdateOnly (new Person { FirstName = " JJ" , Age = 12 },
416
+ db .UpdateOnlyFields (new Person { FirstName = " JJ" , Age = 12 },
417
417
onlyFields : p => new { p .FirstName , p .Age });
418
418
419
- db .UpdateOnly (new Person { FirstName = " JJ" , Age = 12 },
419
+ db .UpdateOnlyFields (new Person { FirstName = " JJ" , Age = 12 },
420
420
onlyFields : p => new [] { " Name" , " Age" });
421
421
```
422
422
423
423
When present, the second expression is used as the where filter:
424
424
425
425
``` csharp
426
- db .UpdateOnly (new Person { FirstName = " JJ" },
426
+ db .UpdateOnlyFields (new Person { FirstName = " JJ" },
427
427
onlyFields : p => p .FirstName ,
428
428
where : p => p .LastName == " Hendrix" );
429
429
```
@@ -433,7 +433,7 @@ Instead of using the expression filters above you can choose to use an SqlExpres
433
433
var q = db .From <Person >()
434
434
.Update (p => p .FirstName );
435
435
436
- db .UpdateOnly (new Person { FirstName = " JJ" , LastName = " Hendo" }, onlyFields : q );
436
+ db .UpdateOnlyFields (new Person { FirstName = " JJ" , LastName = " Hendo" }, onlyFields : q );
437
437
```
438
438
439
439
Using an Object Dictionary:
@@ -443,7 +443,7 @@ var updateFields = new Dictionary<string,object> {
443
443
[nameof (Person .FirstName )] = " JJ" ,
444
444
};
445
445
446
- db .UpdateOnly <Person >(updateFields , p => p .LastName == " Hendrix" );
446
+ db .UpdateOnlyFields <Person >(updateFields , p => p .LastName == " Hendrix" );
447
447
```
448
448
449
449
Using a typed SQL Expression:
@@ -453,7 +453,7 @@ var q = db.From<Person>()
453
453
.Where (x => x .FirstName == " Jimi" )
454
454
.Update (p => p .FirstName );
455
455
456
- db .UpdateOnly (new Person { FirstName = " JJ" }, onlyFields : q );
456
+ db .UpdateOnlyFields (new Person { FirstName = " JJ" }, onlyFields : q );
457
457
```
458
458
459
459
### Updating existing values
0 commit comments