Skip to content

Commit 9001525

Browse files
authored
Update viewcomponents.md
The ".WithData" clauses in the Act and Assert sections need to be set to ``` .WithData(CartItemData.GetMany("TestCart", "TestAlbum")) ``` to work.
1 parent 8b0a9ee commit 9001525

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)