Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit f3d1b42

Browse files
committed
Update README.md
1 parent f0a8241 commit f3d1b42

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,23 +407,23 @@ The second argument lets you specify a filter for updates:
407407
db.UpdateOnly(() => new Person { FirstName = "JJ" }, where: p => p.LastName == "Hendrix");
408408
```
409409

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`
411411
statement is used to specify which fields should be updated:
412412

413413
```csharp
414-
db.UpdateOnly(new Person { FirstName = "JJ" }, onlyFields: p => p.FirstName);
414+
db.UpdateOnlyFields(new Person { FirstName = "JJ" }, onlyFields: p => p.FirstName);
415415

416-
db.UpdateOnly(new Person { FirstName = "JJ", Age = 12 },
416+
db.UpdateOnlyFields(new Person { FirstName = "JJ", Age = 12 },
417417
onlyFields: p => new { p.FirstName, p.Age });
418418

419-
db.UpdateOnly(new Person { FirstName = "JJ", Age = 12 },
419+
db.UpdateOnlyFields(new Person { FirstName = "JJ", Age = 12 },
420420
onlyFields: p => new[] { "Name", "Age" });
421421
```
422422

423423
When present, the second expression is used as the where filter:
424424

425425
```csharp
426-
db.UpdateOnly(new Person { FirstName = "JJ" },
426+
db.UpdateOnlyFields(new Person { FirstName = "JJ" },
427427
onlyFields: p => p.FirstName,
428428
where: p => p.LastName == "Hendrix");
429429
```
@@ -433,7 +433,7 @@ Instead of using the expression filters above you can choose to use an SqlExpres
433433
var q = db.From<Person>()
434434
.Update(p => p.FirstName);
435435

436-
db.UpdateOnly(new Person { FirstName = "JJ", LastName = "Hendo" }, onlyFields: q);
436+
db.UpdateOnlyFields(new Person { FirstName = "JJ", LastName = "Hendo" }, onlyFields: q);
437437
```
438438

439439
Using an Object Dictionary:
@@ -443,7 +443,7 @@ var updateFields = new Dictionary<string,object> {
443443
[nameof(Person.FirstName)] = "JJ",
444444
};
445445

446-
db.UpdateOnly<Person>(updateFields, p => p.LastName == "Hendrix");
446+
db.UpdateOnlyFields<Person>(updateFields, p => p.LastName == "Hendrix");
447447
```
448448

449449
Using a typed SQL Expression:
@@ -453,7 +453,7 @@ var q = db.From<Person>()
453453
.Where(x => x.FirstName == "Jimi")
454454
.Update(p => p.FirstName);
455455

456-
db.UpdateOnly(new Person { FirstName = "JJ" }, onlyFields: q);
456+
db.UpdateOnlyFields(new Person { FirstName = "JJ" }, onlyFields: q);
457457
```
458458

459459
### Updating existing values

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /