283 references to AddContent
Microsoft.AspNetCore.Components (2)
Rendering\RenderTreeBuilder.cs (1)
154
=>
AddContent
(sequence, textContent?.ToString());
Routing\Router.cs (1)
270
builder.
AddContent
(0, "Not found");
Microsoft.AspNetCore.Components.Authorization (2)
AuthorizeRouteView.cs (2)
24
= state => builder => builder.
AddContent
(0, "Not authorized");
26
= builder => builder.
AddContent
(0, "Authorizing...");
Microsoft.AspNetCore.Components.Authorization.Tests (18)
AuthorizeRouteViewTest.cs (6)
184
state => builder => builder.
AddContent
(0, $"Go away, {state.User.Identity.Name}");
209
state => builder => builder.
AddContent
(0, $"Go away, {state.User.Identity.Name}");
253
builder => builder.
AddContent
(0, "Hold on, we're checking your papers.");
386
builder.
AddContent
(0, $"Hello from the page with message: {Message}");
394
builder.
AddContent
(0, "Layout starts here");
396
builder.
AddContent
(2, "Layout ends here");
AuthorizeViewTest.cs (10)
30
context => builder => builder.
AddContent
(0, "This should not be rendered"));
58
context => builder => builder.
AddContent
(0, $"You are not authorized, even though we know you are {context.User.Identity.Name}"));
122
builder.
AddContent
(0, $"You are authenticated as {context.User.Identity.Name}"));
158
builder.
AddContent
(0, $"You are authenticated as {context.User.Identity.Name}"));
194
builder.
AddContent
(0, $"You are authenticated as {context.User.Identity.Name}"));
259
context => builder => builder.
AddContent
(0, "You are not authorized"));
300
authorizing: builder => builder.
AddContent
(0, "Auth pending..."),
301
authorized: context => builder => builder.
AddContent
(0, $"Hello, {context.User.Identity.Name}!"));
359
authorizing: builder => builder.
AddContent
(0, "Auth pending..."),
360
authorized: context => builder => builder.
AddContent
(0, $"Hello, {context.User.Identity.Name}!"));
CascadingAuthenticationStateTest.cs (2)
166
builder.
AddContent
(0, $"Authenticated: {identity.IsAuthenticated}; Name: {identity.Name}; Pending: False; Renders: {numRenders}");
170
builder.
AddContent
(0, $"Authenticated: False; Name: ; Pending: True; Renders: {numRenders}");
Microsoft.AspNetCore.Components.Performance (4)
RenderTreeDiffBuilderBenchmark.cs (4)
33
original.
AddContent
(6, "Car");
45
original.
AddContent
(15, "");
59
modified.
AddContent
(6, "Car");
72
modified.
AddContent
(15, "No, you can't afford that.");
Microsoft.AspNetCore.Components.QuickGrid (1)
Columns\PropertyColumn.cs (1)
79
=> builder.
AddContent
(0, _cellTextFunc!(item));
Microsoft.AspNetCore.Components.Server.Tests (16)
Circuits\CircuitHostTest.cs (2)
871
builder.
AddContent
(0, Message);
911
builder.
AddContent
(1, "some text");
Circuits\RemoteRendererTest.cs (14)
41
builder.
AddContent
(1, "some text");
62
builder.
AddContent
(1, "some text");
86
builder.
AddContent
(1, "some text");
111
builder.
AddContent
(0, $"Value {i}");
149
builder.
AddContent
(1, "some text");
206
builder.
AddContent
(1, "some text");
226
builder.
AddContent
(1, "offline text");
269
builder.
AddContent
(1, "some text");
289
builder.
AddContent
(1, "offline text");
337
builder.
AddContent
(1, "some text");
352
builder.
AddContent
(1, "offline text");
394
builder.
AddContent
(1, "some text");
409
builder.
AddContent
(1, "offline text");
735
builder.
AddContent
(1, "some text");
Microsoft.AspNetCore.Components.Tests (206)
CascadingParameterTest.cs (7)
942
builder.
AddContent
(0, $"CascadingParameter={CascadingParameter}; RegularParameter={RegularParameter}");
966
builder.
AddContent
(0, $"CascadingParameter={CascadingParameter}");
986
builder.
AddContent
(0, $"CascadingParameter={CascadingParameter}");
1012
builder.
AddContent
(0, $"CascadingParameter={CascadingParameter}; SingleDeliveryCascadingParameter={SingleDeliveryCascadingParameter.Text}; RegularParameter={RegularParameter}");
1079
builder.
AddContent
(0, $"Value 1 is '{Value}'.");
1090
builder.
AddContent
(0, $"Value 2 is '{Value}'.");
1101
builder.
AddContent
(0, $"The value is '{Value}'");
DynamicComponentTest.cs (2)
75
builder.
AddContent
(0, "This is some child content");
135
builder.
AddContent
(0, $"Hello from TestComponent with IntProp={IntProp}");
LayoutViewTest.cs (15)
43
builder.
AddContent
(123, "Hello");
44
builder.
AddContent
(456, "Goodbye");
91
builder.
AddContent
(123, "Hello");
92
builder.
AddContent
(456, "Goodbye");
123
builder.
AddContent
(123, "Hello");
124
builder.
AddContent
(456, "Goodbye");
164
builder.
AddContent
(0, "Initial content");
174
builder.
AddContent
(0, "Changed content");
208
builder.
AddContent
(0, "Some content");
288
builder.
AddContent
(0, "RootLayout starts here");
290
builder.
AddContent
(2, "RootLayout ends here");
302
builder.
AddContent
(0, "NestedLayout starts here");
304
builder.
AddContent
(2, "NestedLayout ends here");
316
builder.
AddContent
(0, "OtherNestedLayout starts here");
318
builder.
AddContent
(2, "OtherNestedLayout ends here");
RendererTest.cs (32)
36
builder.
AddContent
(1, "some text");
64
builder.
AddContent
(0, "Hello");
2039
builder.
AddContent
(0, message);
2278
builder.
AddContent
(0, "Hello");
2318
builder.
AddContent
(0, "Hello");
2352
builder.
AddContent
(0, "Hello");
2392
builder.
AddContent
(0, "Hello");
2437
builder.
AddContent
(0, "Hello");
2476
builder.
AddContent
(0, "Hello");
2511
builder.
AddContent
(0, "Hello");
2561
builder.
AddContent
(0, "Hello");
2846
builder.
AddContent
(0, "Child event count: " + eventCount);
2936
builder.
AddContent
(0, $"Render count: {++renderCount}");
2972
builder.
AddContent
(2, $"Parent render count: {++parentRenderCount}");
3032
builder.
AddContent
(0, "Some frame so the child isn't at position zero");
3279
builder.
AddContent
(5, "child text");
4169
builder.
AddContent
(1, "some text");
4212
builder.
AddContent
(0, "Hello");
4240
builder.
AddContent
(0, "Hello");
4272
builder.
AddContent
(0, "Hello");
4300
builder.
AddContent
(0, "Hello");
4905
builder.
AddContent
(0, "Hello");
4993
builder.
AddContent
(1, "some text");
5015
builder.
AddContent
(1, "some text");
5232
builder.
AddContent
(0, Message);
5246
builder.
AddContent
(2, Text);
5358
builder.
AddContent
(6, $"Render count: {++renderCount}");
5378
builder.
AddContent
(0, "Parent here");
5410
builder.
AddContent
(0, "Child is here");
5466
builder.
AddContent
(0, $"Hello from {nameof(MultiRendererComponent)}");
5684
builder.
AddContent
(1, $"Id: {component.TestId} BuildRenderTree, {Guid.NewGuid()}");
6031
builder.
AddContent
(1, "Hello");
Rendering\RenderTreeBuilderTest.cs (28)
33
builder.
AddContent
(0, "First item");
34
builder.
AddContent
(0, nullString);
35
builder.
AddContent
(0, "Second item");
161
builder.
AddContent
(0, "some frame so that the element isn't at position zero");
179
builder.
AddContent
(0, "child 1");
180
builder.
AddContent
(0, "child 2");
182
builder.
AddContent
(0, "unrelated item");
197
builder.
AddContent
(0, "standalone text 1"); // 0: standalone text 1
199
builder.
AddContent
(0, "root text 1"); // 2: root text 1
200
builder.
AddContent
(0, "root text 2"); // 3: root text 2
202
builder.
AddContent
(0, "child text"); // 5: child text
204
builder.
AddContent
(0, "grandchild text 1"); // 7: grandchild text 1
205
builder.
AddContent
(0, "grandchild text 2"); // 8: grandchild text 2
208
builder.
AddContent
(0, "root text 3"); // 9: root text 3
212
builder.
AddContent
(0, "standalone text 2"); // 11: standalone text 2
243
builder.
AddContent
(0, "some text"); // 5: some text
477
builder.
AddContent
(1, "hello");
492
builder.
AddContent
(1, "hello");
507
builder.
AddContent
(1, "hello");
663
builder.
AddContent
(3, "Hello"); // 2: Hello
668
builder.
AddContent
(6, "Goodbye"); // 5: Goodbye
689
fragmentBuilder.
AddContent
(0, "Hello from the fragment");
691
fragmentBuilder.
AddContent
(2, "Some text");
720
builder.
AddContent
(3, "some text"); // 3: some text
809
builder.
AddContent
(3, "some text"); // 3: some text
894
builder.
AddContent
(0, "some text");
896
builder.
AddContent
(2, "more text");
1871
builder.
AddContent
(0, "hey");
RenderTreeDiffBuilderTest.cs (114)
51
builder => builder.
AddContent
(0, "Hello"),
74
oldTree.
AddContent
(0, "text0");
75
oldTree.
AddContent
(2, "text2");
76
newTree.
AddContent
(0, "text0");
77
newTree.
AddContent
(1, "text1");
78
newTree.
AddContent
(2, "text2");
97
oldTree.
AddContent
(0, "text0");
98
oldTree.
AddContent
(1, "text1");
99
oldTree.
AddContent
(2, "text2");
100
newTree.
AddContent
(0, "text0");
101
newTree.
AddContent
(2, "text2");
117
oldTree.
AddContent
(1, "Existing");
122
newTree.
AddContent
(1, "Inserted");
127
newTree.
AddContent
(1, "Existing");
152
oldTree.
AddContent
(1, "First");
157
oldTree.
AddContent
(1, "Second");
162
newTree.
AddContent
(1, "Second");
182
oldTree.
AddContent
(1, "Original");
187
newTree.
AddContent
(1, "Inserted");
558
oldTree.
AddContent
(0, "x"); // Loop start
559
oldTree.
AddContent
(1, "x"); // Will be removed
560
oldTree.
AddContent
(2, "x"); // Will be removed
561
oldTree.
AddContent
(0, "x"); // Loop start
562
newTree.
AddContent
(0, "x"); // Loop start
563
newTree.
AddContent
(0, "x"); // Loop start
578
oldTree.
AddContent
(10, "x"); // Loop start
579
oldTree.
AddContent
(10, "x"); // Loop start
580
newTree.
AddContent
(10, "x"); // Loop start
581
newTree.
AddContent
(11, "x"); // Will be added
582
newTree.
AddContent
(12, "x"); // Will be added
583
newTree.
AddContent
(10, "x"); // Loop start
608
oldTree.
AddContent
(0, "x");
609
oldTree.
AddContent
(1, "x");
610
oldTree.
AddContent
(0, "x"); // Will be removed
611
oldTree.
AddContent
(1, "x"); // Will be removed
612
newTree.
AddContent
(0, "x");
613
newTree.
AddContent
(1, "x");
628
oldTree.
AddContent
(10, "x");
629
oldTree.
AddContent
(11, "x");
630
newTree.
AddContent
(10, "x");
631
newTree.
AddContent
(11, "x");
632
newTree.
AddContent
(10, "x"); // Will be added
633
newTree.
AddContent
(11, "x"); // Will be added
658
oldTree.
AddContent
(12, "x");
659
oldTree.
AddContent
(12, "x"); // Note that the '0' and '1' items are not present on this iteration
660
newTree.
AddContent
(12, "x");
661
newTree.
AddContent
(10, "x");
662
newTree.
AddContent
(11, "x");
663
newTree.
AddContent
(12, "x");
688
oldTree.
AddContent
(2, "x");
689
oldTree.
AddContent
(0, "x");
690
oldTree.
AddContent
(1, "x");
691
oldTree.
AddContent
(2, "x");
692
newTree.
AddContent
(2, "x");
693
newTree.
AddContent
(2, "x"); // Note that the '0' and '1' items are not present on this iteration
708
oldTree.
AddContent
(0, "text");
709
newTree.
AddContent
(1, "text");
724
oldTree.
AddContent
(123, "old text 1");
725
oldTree.
AddContent
(182, "old text 2");
726
newTree.
AddContent
(123, "new text 1");
727
newTree.
AddContent
(182, "new text 2");
1320
oldTree.
AddContent
(09, "unrelated");
1324
oldTree.
AddContent
(13, "grandchild old text");
1329
newTree.
AddContent
(09, "unrelated");
1333
newTree.
AddContent
(13, "grandchild new text");
1362
oldTree.
AddContent
(11, "Text that will change");
1365
oldTree.
AddContent
(14, "Text that will not change");
1371
newTree.
AddContent
(11, "Text that has changed");
1374
newTree.
AddContent
(14, "Text that will not change");
1398
oldTree.
AddContent
(10, "text1");
1399
oldTree.
AddContent
(11, "text2");
1400
oldTree.
AddContent
(12, "text3");
1401
oldTree.
AddContent
(13, "text4");
1402
newTree.
AddContent
(10, "text1");
1403
newTree.
AddContent
(11, "text2modified");
1404
newTree.
AddContent
(12, "text3");
1405
newTree.
AddContent
(13, "text4");
1424
oldTree.
AddContent
(0, "Will not change");
1425
newTree.
AddContent
(0, "Will not change");
1428
newTree.
AddContent
(0, "text1");
1452
oldTree.
AddContent
(1, "Start");
1453
oldTree.
AddContent
(3, "End");
1454
newTree.
AddContent
(1, "Start");
1456
newTree.
AddContent
(4, "Text inside region"); // Sequence number is unrelated to outside the region
1458
newTree.
AddContent
(6, "Text inside nested region");
1461
newTree.
AddContent
(3, "End");
1486
oldTree.
AddContent
(1, "Start");
1488
oldTree.
AddContent
(4, "Text inside region"); // Sequence number is unrelated to outside the region
1490
oldTree.
AddContent
(6, "Text inside nested region");
1493
oldTree.
AddContent
(3, "End");
1494
newTree.
AddContent
(1, "Start");
1495
newTree.
AddContent
(3, "End");
1510
oldTree.
AddContent
(1, "Start");
1512
oldTree.
AddContent
(4, "Text inside region");
1513
oldTree.
AddContent
(5, "Text to move");
1517
oldTree.
AddContent
(3, "End");
1518
newTree.
AddContent
(1, "Start");
1520
newTree.
AddContent
(4, "Changed text inside region");
1522
newTree.
AddContent
(5, "Text to move"); // Although it's the same sequence and content, it's now in a different region so not the same
1525
newTree.
AddContent
(3, "End");
1551
oldTree.
AddContent
(10, "text1"); // 0: text1
1554
newTree.
AddContent
(10, "text1"); // 0: text1
1613
oldTree.
AddContent
(10, "text1"); // 0: text1
1620
newTree.
AddContent
(10, "text1"); // 0: text1
1974
oldTree.
AddContent
(1, "First");
1977
oldTree.
AddContent
(2, "Unkeyed item");
1981
oldTree.
AddContent
(1, "Second");
1986
newTree.
AddContent
(1, "Second");
1989
newTree.
AddContent
(2, "Unkeyed item");
1993
newTree.
AddContent
(1, "First modified");
2029
oldTree.
AddContent
(2, "Unkeyed item");
2045
newTree.
AddContent
(2, "Unkeyed item");
2176
oldTree.
AddContent
(1, "Hello!");
2179
newTree.
AddContent
(0, "some text");
RouteViewTest.cs (6)
184
builder.
AddContent
(0, $"Hello from the page with message '{Message}'");
195
builder.
AddContent
(0, $"Hello from the page with message '{Message}'");
206
builder.
AddContent
(0, "Layout starts here");
208
builder.
AddContent
(2, "Layout ends here");
219
builder.
AddContent
(0, "OtherLayout starts here");
221
builder.
AddContent
(2, "OtherLayout ends here");
Routing\RouterTest.cs (2)
33
_router.Found = routeData => (builder) => builder.
AddContent
(0, $"Rendering route matching {routeData.PageType}");
235
{ nameof(Router.NotFound), (RenderFragment)(builder => builder.
AddContent
(0, "Custom content")) },
Microsoft.AspNetCore.Components.Web (3)
Forms\ValidationMessage.cs (1)
76
builder.
AddContent
(3, message);
Forms\ValidationSummary.cs (1)
82
builder.
AddContent
(5, error);
Head\HeadOutlet.cs (1)
62
builder.
AddContent
(1, _defaultTitle);
Microsoft.AspNetCore.Components.Web.Tests (28)
HtmlRendering\HtmlRendererTest.cs (28)
75
rtb.
AddContent
(1, "Hello world!");
98
rtb.
AddContent
(1, "<Hello world!>");
145
rtb.
AddContent
(2, "Hello world!");
178
rtb.
AddContent
(4, "Hello world!");
202
rtb.
AddContent
(2, "Hello world!");
273
rtb.
AddContent
(2, "Hello world!");
302
rtb.
AddContent
(2, "Hello world!");
305
rtb.
AddContent
(4, "Bye Bye world!");
345
rtb.
AddContent
(8, $"Pick value {optionValue}");
353
rtb.
AddContent
(11, "unrelated option");
404
rtb.
AddContent
(3, "Hello <html>-encoded content!");
452
rtb.
AddContent
(3, "Some content");
499
rtb.
AddContent
(1, "Something");
559
rtb.
AddContent
(5, optionValue);
590
rtb.
AddContent
(2, "Hello world!");
621
rtb.
AddContent
(2, "Hello world!");
687
rtb.AddContent(2, rf => rf.
AddContent
(0, "Hello world!"));
716
rtb.AddContent(3, rf => rf.
AddContent
(0, "Hello world!"));
824
builder.
AddContent
(0, "Hello from the section content provider");
841
builder.
AddContent
(1, "Hey!");
991
rtb.
AddContent
(2, name);
995
rtb.
AddContent
(5, name);
1231
builder.
AddContent
(1, Value.ToString(CultureInfo.InvariantCulture));
1261
builder.
AddContent
(1, Value.ToString(CultureInfo.InvariantCulture));
1289
rtb.
AddContent
(2, content);
1331
=> builder.
AddContent
(0, status);
1355
builder.
AddContent
(0, "Hello");
1362
builder.
AddContent
(1, "Goodbye");
Microsoft.AspNetCore.Components.WebView.Test (2)
WebViewManagerTests.cs (2)
134
builder.
AddContent
(1, "Hello world!");
158
builder.
AddContent
(1, "Hello world!");
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
ComponentTagHelperTest.cs (1)
104
builder.
AddContent
(0, "Hello from the component");