Skip to content

Commit 3527613

Browse files
authored
Merge pull request #368 - Updated viewcomponents.md
Updated viewcomponents.md
2 parents 74720ff + 6241098 commit 3527613

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

docs/_docfx/tutorial/viewcomponents.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ MyViewComponent<CartSummaryComponent>
118118
.Instance()
119119
.WithSession(session => session
120120
.WithEntry("Session", "TestCart"))
121-
.WithData(db => db
122-
.WithEntities(entities => entities
123-
.AddRange(GetCartItems("TestCart", "TestAlbum"))))
121+
.WithData(CartItemData.GetMany("TestCart", "TestAlbum"))
124122
.InvokedWith(vc => vc.InvokeAsync()) // <---
125123
```
126124

@@ -133,9 +131,7 @@ MyViewComponent<CartSummaryComponent>
133131
.Instance()
134132
.WithSession(session => session
135133
.WithEntry("Session", "TestCart"))
136-
.WithData(db => db
137-
.WithEntities(entities => entities
138-
.AddRange(GetCartItems("TestCart", "TestAlbum"))))
134+
.WithData(CartItemData.GetMany("TestCart", "TestAlbum"))
139135
.InvokedWith(vc => vc.InvokeAsync())
140136
.ShouldHave() // <---
141137
.ViewBag(viewBag => viewBag

0 commit comments

Comments
 (0)