diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs
index e958e983182f6..b89f3a2d6405d 100644
--- a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs
@@ -4,7 +4,9 @@
#nullable disable
using System.Globalization;
+using System.IO;
using System.Linq;
+using System.Runtime.CompilerServices;
using Microsoft.AspNetCore.Razor.Language.Components;
using Microsoft.AspNetCore.Razor.Test.Common;
using Microsoft.CodeAnalysis;
@@ -35,6 +37,78 @@ protected override string GetDirectoryPath(string testName)
return $"TestFiles/IntegrationTests/ComponentCodeGenerationTest/{testName}";
}
+ ///
+ /// Shadow of the base CompileToAssembly that, after compiling and verifying no
+ /// unexpected C# diagnostics, also asserts a .builder.txt baseline: the
+ /// component's render-tree-builder calls ordered by sequence number (see
+ /// ). Every test calling CompileToAssembly(generated)
+ /// picks up the check with no per-test change; pass
+ /// false to opt a test out (for example
+ /// one whose generated render operations aren't deterministic across runs).
+ ///
+ ///
+ /// The .codegen.cs / .decl.codegen.cs baselines pin the emitted C#
+ /// byte-for-byte, so they move under cosmetic reorganization -- which partial half a
+ /// member lands in, line-pragma layout, whitespace -- that doesn't change what the
+ /// component renders. The builder baseline is a sequence-ordered projection of just the
+ /// render operations: it stays put under that reorganization yet still trips on a real
+ /// change (a different element, a dropped attribute, a renumbered fragment).
+ ///
+ protected CompileToAssemblyResult CompileToAssembly(
+ CompileToCSharpResult cSharpResult,
+ bool assertBuilderBaseline = true,
+ [CallerMemberName] string testName = "")
+ {
+ var result = RazorIntegrationTestBase.CompileToAssembly(cSharpResult);
+ if (assertBuilderBaseline)
+ {
+ AssertBuilderCallsMatchBaseline(cSharpResult, testName);
+ }
+
+ return result;
+ }
+
+ ///
+ /// Diagnostic-expecting overload: shadowed so call sites that pass expected
+ /// diagnostics resolve here. The builder-baseline check is skipped because
+ /// compile-error tests don't emit a meaningful render tree.
+ ///
+ protected new CompileToAssemblyResult CompileToAssembly(
+ CompileToCSharpResult cSharpResult,
+ params DiagnosticDescription[] expectedDiagnostics)
+ {
+ return RazorIntegrationTestBase.CompileToAssembly(cSharpResult, expectedDiagnostics);
+ }
+
+ private void AssertBuilderCallsMatchBaseline(CompileToCSharpResult cSharpResult, string testName)
+ {
+ var dump = BuilderCallDumper.Dump([cSharpResult.Code, cSharpResult.DeclCode]);
+
+ var baselineFilePath = GetBaselineFilePath(cSharpResult.CodeDocument, ".builder.txt", testName);
+ if (GenerateBaselines.ShouldGenerate)
+ {
+ if (dump.Length == 0)
+ {
+ // No render-tree-builder calls (e.g. a code-only component) -- nothing to pin.
+ return;
+ }
+
+ var baselineFullPath = Path.Combine(TestProjectRoot, baselineFilePath);
+ Directory.CreateDirectory(Path.GetDirectoryName(baselineFullPath));
+ File.WriteAllText(baselineFullPath, dump, new System.Text.UTF8Encoding(encoderShouldEmitUTF8Identifier: true));
+ return;
+ }
+
+ var baselineFile = TestFile.Create(baselineFilePath, GetType().Assembly);
+ if (!baselineFile.Exists())
+ {
+ // Component emits no builder calls, or its baseline predates this check.
+ return;
+ }
+
+ Assert.Equal(baselineFile.ReadAllText(), dump);
+ }
+
#region Basics
[Fact]
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown/TestComponent.builder.txt
new file mode 100644
index 0000000000000..f87d83a47a948
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddAttribute("Value", (object)( c ))
+[0002] AddAttribute("ValueChanged", (object)(global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => c = __value, c)))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown_Assignment/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown_Assignment/TestComponent.builder.txt
new file mode 100644
index 0000000000000..924fce4aa7b22
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown_Assignment/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddAttribute("Value", (object)( c1 = c2 ))
+[0002] AddAttribute("ValueChanged", (object)(global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => c1 = c2 = __value, c1 = c2)))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddComponentParameter_DynamicComponentName/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddComponentParameter_DynamicComponentName/TestComponent.builder.txt
new file mode 100644
index 0000000000000..de5a8c4d3a863
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddComponentParameter_DynamicComponentName/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.dynamic. Value ), "Hello")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddComponentParameter_EscapedComponentName/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddComponentParameter_EscapedComponentName/TestComponent.builder.txt
new file mode 100644
index 0000000000000..c7023fad23cfd
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddComponentParameter_EscapedComponentName/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.@int. Value ), "Hello")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddComponentParameter_GlobalNamespace/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddComponentParameter_GlobalNamespace/TestComponent.builder.txt
new file mode 100644
index 0000000000000..be2407e62acb6
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AddComponentParameter_GlobalNamespace/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::MyComponent. Value ), "Hello")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.builder.txt
new file mode 100644
index 0000000000000..96157990b0726
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, async (e) => await Task.Delay(10) ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.builder.txt
new file mode 100644
index 0000000000000..1cc09bfb7eb4f
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, OnClick ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5cf66508a5e24
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, async () => await Task.Delay(10) ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.builder.txt
new file mode 100644
index 0000000000000..1cc09bfb7eb4f
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, OnClick ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AtTransitions/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AtTransitions/TestComponent.builder.txt
new file mode 100644
index 0000000000000..104e0ff30e87b
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/AtTransitions/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] AddContent(x)
+[0001] AddContent(x)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.builder.txt
new file mode 100644
index 0000000000000..8f14f5e63d8e9
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue))))
+[0003] AddComponentParameter(nameof(global::Test.MyComponent.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValue_WithMatchingProperties/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValue_WithMatchingProperties/TestComponent.builder.txt
new file mode 100644
index 0000000000000..b90c3bab44ccc
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValue_WithMatchingProperties/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.builder.txt
new file mode 100644
index 0000000000000..08d500c32ca28
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.OnChanged), (global::System.Action)(__value => ParentValue = __value))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.builder.txt
new file mode 100644
index 0000000000000..ef6207b4ee554
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter("Value", ParentValue)
+[0002] AddComponentParameter("OnChanged", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.builder.txt
new file mode 100644
index 0000000000000..627338dde9c54
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value))
+[0003] AddComponentParameter(nameof(global::Test.MyComponent.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.builder.txt
new file mode 100644
index 0000000000000..afdb3d08354cf
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.builder.txt
new file mode 100644
index 0000000000000..a6154d33e544f
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.dynamic. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.dynamic.ValueChanged), (global::System.Action)(__value => ParentValue = __value))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.builder.txt
new file mode 100644
index 0000000000000..738eb1c7ee86f
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.@int. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.@int.ValueChanged), (global::System.Action)(__value => ParentValue = __value))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..2509ab39404b2
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.builder.txt
new file mode 100644
index 0000000000000..e77818190cdbd
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter("Value", ParentValue)
+[0002] AddComponentParameter("ValueChanged", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.builder.txt
new file mode 100644
index 0000000000000..ef1deec3788c4
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( __value => { ParentValue = __value; global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeSynchronousDelegate( Update ); }))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.builder.txt
new file mode 100644
index 0000000000000..0c494c8417169
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( __value => { ParentValue = __value; global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeSynchronousDelegate( () => { } ); }))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.builder.txt
new file mode 100644
index 0000000000000..ca8479bb2c64f
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredBindSetter(callback: __value => { ParentValue = __value; return global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate(callback: () => { } ); }, value: ParentValue), ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.builder.txt
new file mode 100644
index 0000000000000..870171c129a4c
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredBindSetter(callback: __value => { ParentValue = __value; return global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate(callback: UpdateValue ); }, value: ParentValue), ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_InsideTemplateWithDiscardContext/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_InsideTemplateWithDiscardContext/TestComponent.builder.txt
new file mode 100644
index 0000000000000..ae5579c5d4579
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_InsideTemplateWithDiscardContext/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] OpenComponent()
+[0001] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((_) => (__builder2) => { __builder2.OpenComponent(2); __builder2.AddComponentParameter(3, nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue )); __builder2.AddComponentParameter(4, nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredBindSetter(callback: __value => { ParentValue = __value; return global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate(callback: OnAfter ); }, value: ParentValue), ParentValue)))); var (_, _) = (nameof(global::Test.MyComponent. Value ), 0); __builder2.CloseComponent(); } ))
+[0002] OpenComponent()
+[0003] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0004] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredBindSetter(callback: __value => { ParentValue = __value; return global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate(callback: OnAfter ); }, value: ParentValue), ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.builder.txt
new file mode 100644
index 0000000000000..d2a3c56f7cd3b
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)(async __value => { ParentValue = __value; await global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate( Update ); }))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.builder.txt
new file mode 100644
index 0000000000000..44c95f3961f48
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)(async __value => { ParentValue = __value; await global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate( () => { return Task.CompletedTask; } ); }))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.builder.txt
new file mode 100644
index 0000000000000..6fbd045f05b82
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( UpdateValue ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5f01fd901a852
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( value => ParentValue = value ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.builder.txt
new file mode 100644
index 0000000000000..9c0cd9681d0f0
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, UpdateValue , ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.builder.txt
new file mode 100644
index 0000000000000..788629aa12c15
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, value => ParentValue = value , ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.builder.txt
new file mode 100644
index 0000000000000..9c0cd9681d0f0
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, UpdateValue , ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.builder.txt
new file mode 100644
index 0000000000000..0ab0a0d57fc73
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)( UpdateValue ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.builder.txt
new file mode 100644
index 0000000000000..0a2a20eeed9ce
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)( value => { ParentValue = value; return Task.CompletedTask; } ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.builder.txt
new file mode 100644
index 0000000000000..0c55b069d4937
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.InputText. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( person.Name ))
+[0002] AddComponentParameter(nameof(global::Test.InputText.ValueChanged), (global::System.Action)(__value => person.Name = __value))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.builder.txt
new file mode 100644
index 0000000000000..704df2d489c3f
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue , culture: CultureInfo.InvariantCulture ))
+[0002] AddAttribute("onchange", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue, culture: CultureInfo.InvariantCulture))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..bd9707cccc9a1
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "text")
+[0002] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( CurrentDate , format: "MM/dd"))
+[0003] AddAttribute("onchange", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => CurrentDate = __value, CurrentDate, format: "MM/dd"))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..8303913c10756
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "text")
+[0002] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0003] AddAttribute("onchange", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementWithCulture/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementWithCulture/TestComponent.builder.txt
new file mode 100644
index 0000000000000..d0bdbded4e5a0
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementWithCulture/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("myvalue", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue , culture: CultureInfo.InvariantCulture ))
+[0002] AddAttribute("anotherevent", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue, culture: CultureInfo.InvariantCulture))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementWithSuffix_OverridesEvent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementWithSuffix_OverridesEvent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..6958f4f357a64
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementWithSuffix_OverridesEvent/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("myvalue", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0002] AddAttribute("anotherevent", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..49e98b6795c87
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("myvalue", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0002] AddAttribute("myevent", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithBindAfterAndSuffix/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithBindAfterAndSuffix/TestComponent.builder.txt
new file mode 100644
index 0000000000000..e2dde3feeba6b
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithBindAfterAndSuffix/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("myvalue", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0002] AddAttribute("myevent", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredBindSetter(callback: __value => { ParentValue = __value; return global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate(callback: DoSomething ); }, value: ParentValue), ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithEventAsExplicitExpression/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithEventAsExplicitExpression/TestComponent.builder.txt
new file mode 100644
index 0000000000000..94ac97c15084c
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithEventAsExplicitExpression/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("myvalue", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0002] AddAttribute(x.ToString(), global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithEventAsExpression/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithEventAsExpression/TestComponent.builder.txt
new file mode 100644
index 0000000000000..51b5adbfb490b
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithEventAsExpression/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("myvalue", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0002] AddAttribute(x, global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithGetSetAndSuffix/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithGetSetAndSuffix/TestComponent.builder.txt
new file mode 100644
index 0000000000000..a6dacc1917a04
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithGetSetAndSuffix/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("myvalue", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0002] AddAttribute("myevent", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredBindSetter(callback: ValueChanged , value: ParentValue), ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithStringAttribute_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithStringAttribute_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..49e98b6795c87
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithStringAttribute_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("myvalue", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0002] AddAttribute("myevent", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithoutCloseTag/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithoutCloseTag/TestComponent.builder.txt
new file mode 100644
index 0000000000000..e6de744617d12
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WithoutCloseTag/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] OpenElement("input")
+[0002] AddAttribute("@bind", ParentValue)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..49e98b6795c87
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("div")
+[0001] AddAttribute("myvalue", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0002] AddAttribute("myevent", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.builder.txt
new file mode 100644
index 0000000000000..c49e8fe9c6f9a
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( __value => { ParentValue = __value; global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeSynchronousDelegate( Update ); }))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5ef550d27c7f0
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, UpdateValue , ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5ef550d27c7f0
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, UpdateValue , ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5ef550d27c7f0
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( ParentValue ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, UpdateValue , ParentValue))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.builder.txt
new file mode 100644
index 0000000000000..9692dd8f70567
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "custom")
+[0002] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue ))
+[0003] AddAttribute("anotherevent", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.builder.txt
new file mode 100644
index 0000000000000..aabefc985ec47
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "custom")
+[0002] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( ParentValue , culture: CultureInfo.CurrentCulture ))
+[0003] AddAttribute("anotherevent", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => ParentValue = __value, ParentValue, culture: CultureInfo.CurrentCulture))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..e57be4ea85818
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.builder.txt
@@ -0,0 +1,6 @@
+[0000] OpenElement("div")
+[0001] AddContent(context.ToLowerInvariant())
+[0002] OpenComponent()
+[0003] AddComponentParameter(nameof(global::Test.MyComponent. Header ), (global::Microsoft.AspNetCore.Components.RenderFragment)( header ))
+[0004] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddMarkupContent(5, "\r\n Some Content\r\n"); } ))
+[0005] AddMarkupContent("\r\n Some Content\r\n")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..a1b520f6807a4
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.builder.txt
@@ -0,0 +1,8 @@
+[0000] OpenElement("div")
+[0001] AddContent(context.ToLowerInvariant())
+[0002] OpenComponent()
+[0003] AddComponentParameter(nameof(global::Test.MyComponent. Header ), (global::Microsoft.AspNetCore.Components.RenderFragment)( header ))
+[0004] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddContent(5, "Some Content"); } ))
+[0005] AddContent("Some Content")
+[0006] AddAttribute("Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddContent(7, "Bye!"); } ))
+[0007] AddContent("Bye!")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..14c263470ef56
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "checkbox")
+[0002] AddAttribute("@bind", Enabled)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..2da91e08e79bc
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( CurrentDate , format: "MM/dd"))
+[0002] AddAttribute("oninput", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => CurrentDate = __value, CurrentDate, format: "MM/dd"))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..ad636fae8c15d
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "text")
+[0002] AddAttribute("@bind", CurrentDate)
+[0003] AddAttribute("@bind:format", Format)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..4c0c90a0e0114
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "text")
+[0002] AddAttribute("@bind", CurrentDate)
+[0003] AddAttribute("@bind:format", "MM/dd/yyyy")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..f78b83596f3b0
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "text")
+[0002] AddAttribute("@bind", ParentValue)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithDefaultCultureAndDefaultFormat_Override/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithDefaultCultureAndDefaultFormat_Override/TestComponent.builder.txt
new file mode 100644
index 0000000000000..a73a8d6ed1f81
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithDefaultCultureAndDefaultFormat_Override/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "custom")
+[0002] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( CurrentDate , format: "MM/dd/yyyy", culture: global::System.Globalization.CultureInfo.InvariantCulture))
+[0003] AddAttribute("onchange", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => CurrentDate = __value, CurrentDate, format: "MM/dd/yyyy", culture: global::System.Globalization.CultureInfo.InvariantCulture))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat/TestComponent.builder.txt
new file mode 100644
index 0000000000000..f4ded3ded86b6
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "custom")
+[0002] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( CurrentDate , format: "MM/dd"))
+[0003] AddAttribute("onchange", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => CurrentDate = __value, CurrentDate, format: "MM/dd"))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat_Override/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat_Override/TestComponent.builder.txt
new file mode 100644
index 0000000000000..df7d8b8cd1144
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat_Override/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("type", "custom")
+[0002] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( CurrentDate , format: "MM/dd/yyyy"))
+[0003] AddAttribute("onchange", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => CurrentDate = __value, CurrentDate, format: "MM/dd/yyyy"))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.builder.txt
new file mode 100644
index 0000000000000..e994d4cd68b7a
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( CurrentDate , format: "MM/dd"))
+[0002] AddAttribute("onchange", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => CurrentDate = __value, CurrentDate, format: "MM/dd"))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithSuffix_CanOverrideEvent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithSuffix_CanOverrideEvent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..2da91e08e79bc
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithSuffix_CanOverrideEvent/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( CurrentDate , format: "MM/dd"))
+[0002] AddAttribute("oninput", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => CurrentDate = __value, CurrentDate, format: "MM/dd"))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithoutType_IsCaseSensitive/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithoutType_IsCaseSensitive/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5d84dfcae1323
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithoutType_IsCaseSensitive/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("@BIND", ParentValue)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..feeaf19ff8085
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenElement("input")
+[0001] AddAttribute("@bind", ParentValue)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_02/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_02/TestComponent.builder.txt
new file mode 100644
index 0000000000000..d59975be56168
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_02/TestComponent.builder.txt
@@ -0,0 +1,12 @@
+[0000] OpenElement("div")
+[0000] OpenElement("p")
+[0001] AddAttribute("class", "row")
+[0001] AddContent(context)
+[0002] OpenElement("a")
+[0003] AddAttribute("href", "#")
+[0004] AddAttribute("@onclick", "Toggle")
+[0005] AddAttribute("class", "col-12")
+[0006] AddContent(ActionText)
+[0007] OpenElement("div")
+[0008] AddAttribute("class", "col-12 card card-body")
+[0009] AddContent(ChildContent)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Explicit/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Explicit/TestComponent.builder.txt
new file mode 100644
index 0000000000000..3367867c693ed
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Explicit/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.Grid. Items ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>( Array.Empty() ))
+[0002] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { global::__Blazor.Test.TestComponent.TypeInference.CreateColumn_0(__builder2, 3, default(DateTime)!); global::__Blazor.Test.TestComponent.TypeInference.CreateColumn_1(__builder2, 4, default(DateTime)!); } ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_ExplicitOverride/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_ExplicitOverride/TestComponent.builder.txt
new file mode 100644
index 0000000000000..da6130816e2da
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_ExplicitOverride/TestComponent.builder.txt
@@ -0,0 +1,20 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.Grid. Items ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>( Array.Empty() ))
+[0002] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.OpenComponent>(3); __builder2.CloseComponent(); } ))
+[0003] OpenComponent>()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..299921609e111
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0005] AddContent(context.Year)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints/TestComponent.builder.txt
new file mode 100644
index 0000000000000..153df39416b73
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter("Items", Array.Empty())
+[0002] AddAttribute("ColumnsTemplate", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { global::__Blazor.Test.TestComponent.TypeInference.CreateColumn_0(__builder2, 3, default(WeatherForecast)!, 4, "Date", 5, "Date", 6, "d", 7, "10rem"); } ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.builder.txt
new file mode 100644
index 0000000000000..dd781fe31236d
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter("Items", Array.Empty())
+[0002] AddAttribute("ColumnsTemplate", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { global::__Blazor.Test.TestComponent.TypeInference.CreateColumn_0(__builder2, 3, default(WeatherForecast)!, 4, "Date", 5, "Date", 6, "d", 7, "10rem"); } ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.builder.txt
new file mode 100644
index 0000000000000..7a1bd060b7539
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter("Items", Array.Empty())
+[0002] AddAttribute("ColumnsTemplate", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { global::__Blazor.Test.TestComponent.TypeInference.CreateColumn_0(__builder2, 3, default(WeatherForecast)!, 4, "Date", 5, "Date", 6, "d", 7, "10rem"); } ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_WithConstraints/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_WithConstraints/TestComponent.builder.txt
new file mode 100644
index 0000000000000..153df39416b73
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Inferred_WithConstraints/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter("Items", Array.Empty())
+[0002] AddAttribute("ColumnsTemplate", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { global::__Blazor.Test.TestComponent.TypeInference.CreateColumn_0(__builder2, 3, default(WeatherForecast)!, 4, "Date", 5, "Date", 6, "d", 7, "10rem"); } ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.builder.txt
new file mode 100644
index 0000000000000..e612f96734cd2
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0003] OpenComponent()
+[0004] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder3) => { global::__Blazor.Test.TestComponent.TypeInference.CreateChild_1(__builder3, 5, __typeInferenceArg_0___arg0); } ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_NullableEnabled/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_NullableEnabled/TestComponent.builder.txt
new file mode 100644
index 0000000000000..a4203254b0cc1
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_NullableEnabled/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { global::__Blazor.Test.TestComponent.TypeInference.CreateChild_0(__builder2, 2, default(string)!, 3, (childContext) => (__builder3) => { __builder3.AddContent(4, childContext.Length ); } ); } ))
+[0004] AddContent(childContext.Length)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Override_Multilayer/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Override_Multilayer/TestComponent.builder.txt
new file mode 100644
index 0000000000000..6a03d4eb8059d
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/CascadingGenericInference_Override_Multilayer/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0009] AddMarkupContent("\r\n ")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.builder.txt
new file mode 100644
index 0000000000000..de0640fdd8dcd
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.builder.txt
@@ -0,0 +1,10 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.C. Item ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( 1 ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_Generic/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_Generic/TestComponent.builder.txt
new file mode 100644
index 0000000000000..708158e382880
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_Generic/TestComponent.builder.txt
@@ -0,0 +1,10 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Item ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( "hi" ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericBind/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericBind/TestComponent.builder.txt
new file mode 100644
index 0000000000000..a197473c9559d
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericBind/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Item ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( Value ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent.ItemChanged), (global::System.Action)(__value => Value = __value))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped/TestComponent.builder.txt
new file mode 100644
index 0000000000000..f0e827e973f4d
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter("Item", Value)
+[0002] AddComponentParameter("ItemChanged", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => Value = __value, Value))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericBind_TypeInference/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericBind_TypeInference/TestComponent.builder.txt
new file mode 100644
index 0000000000000..d0b4cccb2f201
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericBind_TypeInference/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0003] AddMarkupContent("\r\n")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericChildContent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericChildContent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..6fb01bf05f1bd
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericChildContent/TestComponent.builder.txt
@@ -0,0 +1,13 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Item ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( "hi" ))
+[0002] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.OpenElement(3, "div"); __builder2.AddContent(4, context.ToLower() ); __builder2.CloseElement(); } ))
+[0003] OpenElement("div")
+[0004] AddContent(context.ToLower())
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericChildContent_TypeInference/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericChildContent_TypeInference/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5ecb25a8480eb
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericChildContent_TypeInference/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0003] OpenElement("div")
+[0004] AddContent(context.ToLower())
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute/TestComponent.builder.txt
new file mode 100644
index 0000000000000..191370d96a06a
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute/TestComponent.builder.txt
@@ -0,0 +1,11 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Item ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( "hi" ))
+[0002] AddComponentParameter("Other", 17)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_Generic_TypeInference_Multiple/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_Generic_TypeInference_Multiple/TestComponent.builder.txt
new file mode 100644
index 0000000000000..b612c03010e1b
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_Generic_TypeInference_Multiple/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0002] AddMarkupContent("\r\n")
+[0005] AddMarkupContent("\r\n")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.builder.txt
new file mode 100644
index 0000000000000..f31a8aa45a8ed
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.builder.txt
new file mode 100644
index 0000000000000..f31a8aa45a8ed
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_MultipleGenerics/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_MultipleGenerics/TestComponent.builder.txt
new file mode 100644
index 0000000000000..918011578d563
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_MultipleGenerics/TestComponent.builder.txt
@@ -0,0 +1,24 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Item ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( "hi" ))
+[0002] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.OpenElement(3, "div"); __builder2.AddContent(4, context.ToLower() ); __builder2.CloseElement(); } ))
+[0003] OpenElement("div")
+[0004] AddContent(context.ToLower())
+[0005] AddAttribute("AnotherChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment.Context>)((item) => (__builder2) => { __builder2.AddContent(6, System.Math.Max(0, item.Item) ); __builder2.AddMarkupContent(7, ";\r\n"); } ))
+[0006] AddContent(System.Math.Max(0, item.Item))
+[0007] AddMarkupContent(";\r\n")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_MultipleGenerics_TypeInference/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_MultipleGenerics_TypeInference/TestComponent.builder.txt
new file mode 100644
index 0000000000000..2534856097afd
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_MultipleGenerics_TypeInference/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0004] OpenElement("div")
+[0005] AddContent(context.ToLower())
+[0007] AddContent(System.Math.Max(0, item.Item))
+[0008] AddMarkupContent(";\r\n")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.builder.txt
new file mode 100644
index 0000000000000..1d330c115e588
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0003] AddContent(context.ToLower())
+[0005] AddContent(context)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_Simple/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_Simple/TestComponent.builder.txt
new file mode 100644
index 0000000000000..f31a8aa45a8ed
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_Simple/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithChildContent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithChildContent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..d8e4a948ef437
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithChildContent/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. MyAttr ), "abc")
+[0002] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddContent(3, "Some text"); __builder2.AddMarkupContent(4, "Nested text"); } ))
+[0003] AddContent("Some text")
+[0004] AddMarkupContent("Nested text")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithElementOnlyChildContent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithElementOnlyChildContent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..b85f427debdf0
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithElementOnlyChildContent/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddMarkupContent(2, "hello"); } ))
+[0002] AddMarkupContent("hello")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitChildContent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitChildContent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..879f7a687c2e2
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitChildContent/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddContent(2, "hello"); } ))
+[0002] AddContent("hello")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.builder.txt
new file mode 100644
index 0000000000000..02cc1061f745c
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. OnClick ), (global::System.Action)( Increment ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..c64ca4080608a
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.AddContent(2, context ); } ))
+[0002] AddContent(context)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitStringParameter/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitStringParameter/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5276380b5ffc6
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithExplicitStringParameter/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. StringProperty ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( 42.ToString() ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5480805f6a58c
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.builder.txt
@@ -0,0 +1,7 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. MyAttr ), "abc")
+[0002] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.AddContent(3, "Some text"); __builder2.OpenElement(4, "some-child"); __builder2.AddAttribute(5, "a", "1"); __builder2.AddContent(6, context.ToLowerInvariant() ); __builder2.CloseElement(); } ))
+[0003] AddContent("Some text")
+[0004] OpenElement("some-child")
+[0005] AddAttribute("a", "1")
+[0006] AddContent(context.ToLowerInvariant())
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.builder.txt
new file mode 100644
index 0000000000000..2d4894c24c104
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.builder.txt
@@ -0,0 +1,7 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. MyAttr ), "abc")
+[0002] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { __builder2.AddMarkupContent(3, "\r\n Some text"); __builder2.OpenElement(4, "some-child"); __builder2.AddAttribute(5, "a", "1"); __builder2.AddContent(6, item.ToLowerInvariant() ); __builder2.CloseElement(); } ))
+[0003] AddMarkupContent("\r\n Some text")
+[0004] OpenElement("some-child")
+[0005] AddAttribute("a", "1")
+[0006] AddContent(item.ToLowerInvariant())
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.builder.txt
new file mode 100644
index 0000000000000..2d4894c24c104
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.builder.txt
@@ -0,0 +1,7 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. MyAttr ), "abc")
+[0002] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { __builder2.AddMarkupContent(3, "\r\n Some text"); __builder2.OpenElement(4, "some-child"); __builder2.AddAttribute(5, "a", "1"); __builder2.AddContent(6, item.ToLowerInvariant() ); __builder2.CloseElement(); } ))
+[0003] AddMarkupContent("\r\n Some text")
+[0004] OpenElement("some-child")
+[0005] AddAttribute("a", "1")
+[0006] AddContent(item.ToLowerInvariant())
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.builder.txt
new file mode 100644
index 0000000000000..df10d95682fbd
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. OnClick ), (global::System.Action)( e => { Increment(); } ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithNonPropertyAttributes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithNonPropertyAttributes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5f97fe9a7cd2e
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithNonPropertyAttributes/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter("some-attribute", "foo")
+[0002] AddComponentParameter("another-attribute", 43.ToString())
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithPageDirective/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithPageDirective/TestComponent.builder.txt
new file mode 100644
index 0000000000000..f31a8aa45a8ed
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithPageDirective/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithParameters/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithParameters/TestComponent.builder.txt
new file mode 100644
index 0000000000000..c9c6c5e43afa5
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithParameters/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. IntProperty ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( 123 ))
+[0002] AddComponentParameter(nameof(global::Test.MyComponent. BoolProperty ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( true ))
+[0003] AddComponentParameter(nameof(global::Test.MyComponent. StringProperty ), "My string")
+[0004] AddComponentParameter(nameof(global::Test.MyComponent. ObjectProperty ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( new SomeType() ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.builder.txt
new file mode 100644
index 0000000000000..94ed05d019d3b
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter("onclick", global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, OnClick ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.builder.txt
new file mode 100644
index 0000000000000..4ab6fab68029f
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.builder.txt
@@ -0,0 +1,15 @@
+[0000] OpenComponent()
+[0001] AddAttribute("Header", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddContent(2, "Hi!"); } ))
+[0002] AddContent("Hi!")
+[0003] AddMarkupContent("\r\n")
+[0004] OpenComponent()
+[0005] AddAttribute("Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.AddContent(6, context ); } ))
+[0006] AddContent(context)
+[0007] AddMarkupContent("\r\n")
+[0008] OpenComponent()
+[0009] AddAttribute("Header", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddContent(10, "Hi!"); } ))
+[0010] AddContent("Hi!")
+[0011] AddMarkupContent("\r\n")
+[0012] OpenComponent()
+[0013] AddAttribute("Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.AddContent(14, context ); } ))
+[0014] AddContent(context)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentAttribute_WithDoubleAtEscape/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentAttribute_WithDoubleAtEscape/TestComponent.builder.txt
new file mode 100644
index 0000000000000..e46375b3b0984
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentAttribute_WithDoubleAtEscape/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. Value ), "@currentCount")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentImports_GlobalPrefix/Index.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentImports_GlobalPrefix/Index.builder.txt
new file mode 100644
index 0000000000000..3b99148858bc2
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentImports_GlobalPrefix/Index.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithBooleanParameter/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithBooleanParameter/TestComponent.builder.txt
new file mode 100644
index 0000000000000..5b226bca86184
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithBooleanParameter/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] OpenElement("strong")
+[0001] AddContent(TestBool)
+[0002] AddMarkupContent("\r\n\r\n")
+[0003] OpenComponent()
+[0004] AddComponentParameter(nameof(global::Test.TestComponent. TestBool ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( true ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithBooleanParameter_Minimized/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithBooleanParameter_Minimized/TestComponent.builder.txt
new file mode 100644
index 0000000000000..0d164bac8d34c
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithBooleanParameter_Minimized/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] OpenElement("strong")
+[0001] AddContent(TestBool)
+[0002] AddMarkupContent("\r\n\r\n")
+[0003] OpenComponent()
+[0004] AddComponentParameter(nameof(global::Test.TestComponent. TestBool ), true)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.builder.txt
new file mode 100644
index 0000000000000..9c31b3688c67e
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] AddMarkupContent("Item1
")
+[0001] OpenElement("p")
+[0002] AddContent(ChildContent(item2))
+[0003] AddMarkupContent(";\r\n ")
+[0004] AddMarkupContent("Item3
")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.builder.txt
new file mode 100644
index 0000000000000..b4d3c661c7fbd
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0005] OpenElement("p")
+[0006] AddContent(context)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.builder.txt
new file mode 100644
index 0000000000000..9c31b3688c67e
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] AddMarkupContent("Item1
")
+[0001] OpenElement("p")
+[0002] AddContent(ChildContent(item2))
+[0003] AddMarkupContent(";\r\n ")
+[0004] AddMarkupContent("Item3
")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.builder.txt
new file mode 100644
index 0000000000000..b4d3c661c7fbd
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0005] OpenElement("p")
+[0006] AddContent(context)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithDecimalParameter/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithDecimalParameter/TestComponent.builder.txt
new file mode 100644
index 0000000000000..117361569c55b
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithDecimalParameter/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] OpenElement("strong")
+[0001] AddContent(TestDecimal)
+[0002] AddMarkupContent("\r\n\r\n")
+[0003] OpenComponent()
+[0004] AddComponentParameter(nameof(global::Test.TestComponent. TestDecimal ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( 4 ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithDynamicParameter/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithDynamicParameter/TestComponent.builder.txt
new file mode 100644
index 0000000000000..9f51ede2085c7
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithDynamicParameter/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] OpenElement("strong")
+[0001] AddContent(TestDynamic)
+[0002] AddMarkupContent("\r\n\r\n")
+[0003] OpenComponent()
+[0004] AddComponentParameter(nameof(global::Test.TestComponent. TestDynamic ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( 4 ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTupleParameter/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTupleParameter/TestComponent.builder.txt
new file mode 100644
index 0000000000000..84bcc75b8d6fe
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTupleParameter/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.TestComponent. Gutter ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<(global::System.Int32 Horizontal, global::System.Int32 Vertical)>( (32, 16) ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.builder.txt
new file mode 100644
index 0000000000000..33707c301874f
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.builder.txt
@@ -0,0 +1,7 @@
+[0000] AddMarkupContent("Item
\r\n\r\n")
+[0001] OpenElement("p")
+[0002] AddContent(ChildContent(Items1))
+[0003] OpenElement("p")
+[0004] AddContent(ChildContent(item))
+[0005] OpenElement("p")
+[0006] AddContent(ChildContent(Items3()))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.builder.txt
new file mode 100644
index 0000000000000..36fb6cb498369
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0005] OpenElement("p")
+[0006] AddContent(context[0].description)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.builder.txt
new file mode 100644
index 0000000000000..0e7a864ff6f8b
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] AddMarkupContent("Item
\r\n\r\n")
+[0001] OpenElement("p")
+[0002] AddContent(ChildContent(Item1))
+[0003] OpenElement("p")
+[0004] AddContent(ChildContent(item))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.builder.txt
new file mode 100644
index 0000000000000..ec9e9d8da7297
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0004] OpenElement("p")
+[0005] AddContent(context)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.builder.txt
new file mode 100644
index 0000000000000..6dabbf862ce04
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0003] AddContent(context.I1.MyClassId)
+[0004] AddContent(" - ")
+[0005] AddContent(context.I2.MyStructId)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTuple_ExplicitGenericArguments/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTuple_ExplicitGenericArguments/TestComponent.builder.txt
new file mode 100644
index 0000000000000..8ffb6ad7af032
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameterValueTuple_ExplicitGenericArguments/TestComponent.builder.txt
@@ -0,0 +1,18 @@
+[0000] OpenComponent>()
+[0001] AddComponentParameter(nameof(global::Test.TestComponent. Data ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>( null ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameters/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameters/TestComponent.builder.txt
new file mode 100644
index 0000000000000..76f8d202d5ac1
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameters/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] AddMarkupContent("Item1
")
+[0001] OpenElement("p")
+[0002] AddContent(ChildContent(item2))
+[0003] AddMarkupContent(";\r\n ")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.builder.txt
new file mode 100644
index 0000000000000..76f8d202d5ac1
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] AddMarkupContent("Item1
")
+[0001] OpenElement("p")
+[0002] AddContent(ChildContent(item2))
+[0003] AddMarkupContent(";\r\n ")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_AddContent_Multiline/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_AddContent_Multiline/TestComponent.builder.txt
new file mode 100644
index 0000000000000..334a28400cb40
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_AddContent_Multiline/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] AddContent(@"This is a multiline string")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.builder.txt
new file mode 100644
index 0000000000000..4ebfe67f30bad
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddMarkupContent("\r\n")
+[0002] OpenElement("SomeComponent")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_MatchingIsCaseSensitive/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_MatchingIsCaseSensitive/TestComponent.builder.txt
new file mode 100644
index 0000000000000..dad92834a56d0
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_MatchingIsCaseSensitive/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] OpenComponent()
+[0001] AddMarkupContent("\r\n\r\n")
+[0002] OpenComponent()
+[0003] AddComponentParameter(nameof(global::Test.MyComponent. IntProperty ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( 1 ))
+[0004] AddComponentParameter(nameof(global::Test.MyComponent. BoolProperty ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( true ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_MultipleComponentsDifferByCase/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_MultipleComponentsDifferByCase/TestComponent.builder.txt
new file mode 100644
index 0000000000000..f984cd22283e1
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_MultipleComponentsDifferByCase/TestComponent.builder.txt
@@ -0,0 +1,5 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.MyComponent. IntProperty ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( 1 ))
+[0002] AddMarkupContent("\r\n")
+[0003] OpenComponent()
+[0004] AddComponentParameter(nameof(global::Test.Mycomponent. IntProperty ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( 2 ))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.builder.txt
new file mode 100644
index 0000000000000..7db1a3aea3302
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.builder.txt
new file mode 100644
index 0000000000000..dc62fa686d82b
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_PreserveWhitespaceDirective_InImports/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_PreserveWhitespaceDirective_InImports/TestComponent.builder.txt
new file mode 100644
index 0000000000000..73fc337c6c270
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_PreserveWhitespaceDirective_InImports/TestComponent.builder.txt
@@ -0,0 +1,8 @@
+[0000] OpenElement("parent")
+[0001] AddMarkupContent("\r\n ")
+[0002] OpenElement("child")
+[0003] AddContent(" ")
+[0004] AddContent(DateTime.Now)
+[0005] AddContent(" ")
+[0006] AddMarkupContent("\r\n")
+[0007] AddMarkupContent("\r\n\r\n")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_PreserveWhitespaceDirective_OverrideImports/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_PreserveWhitespaceDirective_OverrideImports/TestComponent.builder.txt
new file mode 100644
index 0000000000000..74bce65a8f0c4
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_PreserveWhitespaceDirective_OverrideImports/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenElement("parent")
+[0001] OpenElement("child")
+[0002] AddContent(DateTime.Now)
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_TextTagsAreNotRendered/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_TextTagsAreNotRendered/TestComponent.builder.txt
new file mode 100644
index 0000000000000..c7911e0f6e2be
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_TextTagsAreNotRendered/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddContent("This text is rendered")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithCssScope/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithCssScope/TestComponent.builder.txt
new file mode 100644
index 0000000000000..c8f306d8bf846
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithCssScope/TestComponent.builder.txt
@@ -0,0 +1,28 @@
+[0000] AddMarkupContent("Element with no attributes
\r\n")
+[0000] OpenElement("li")
+[0001] AddAttribute("data-index", i)
+[0001] OpenElement("parent")
+[0002] AddAttribute("TestCssScope")
+[0002] AddAttribute("with-attributes", "yes")
+[0003] AddAttribute("with-csharp-attribute-value", 123)
+[0003] AddContent("Something ")
+[0004] AddAttribute("TestCssScope")
+[0004] AddContent(i)
+[0005] AddMarkupContent("\r\n ")
+[0006] AddMarkupContent("With text\r\n ")
+[0007] OpenComponent()
+[0008] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddMarkupContent(9, "This is in child content"); } ))
+[0009] AddMarkupContent("This is in child content")
+[0010] AddComponentReferenceCapture((__value) => { myComponentReference = (global::Test.TemplatedComponent)__value; })
+[0011] OpenElement("with-ref-capture")
+[0012] AddAttribute("some-attr")
+[0013] AddAttribute("TestCssScope")
+[0014] AddElementReferenceCapture((__value) => { myElementReference = __value; })
+[0015] AddContent("Content")
+[0016] AddMarkupContent("\r\n ")
+[0017] OpenElement("input")
+[0018] AddAttribute("id", "myElem")
+[0019] AddAttribute("another-attr", "Another attr value")
+[0020] AddAttribute("value", global::Microsoft.AspNetCore.Components.BindConverter.FormatValue( myVariable ))
+[0021] AddAttribute("onchange", global::Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => myVariable = __value, myVariable))
+[0022] AddAttribute("TestCssScope")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithDocType/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithDocType/TestComponent.builder.txt
new file mode 100644
index 0000000000000..147e6df0357ca
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithDocType/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] AddMarkupContent("\r\n")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_NoValueSpecified/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_NoValueSpecified/TestComponent.builder.txt
new file mode 100644
index 0000000000000..81a411a0dfb55
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_NoValueSpecified/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified/TestComponent.builder.txt
new file mode 100644
index 0000000000000..692a76be1ad99
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddMarkupContent(2, "Hello World
"); } ))
+[0002] AddMarkupContent("Hello World
")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecifiedAsText_WithoutName/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecifiedAsText_WithoutName/TestComponent.builder.txt
new file mode 100644
index 0000000000000..72d8fbc08eb1c
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecifiedAsText_WithoutName/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddContent(2, "This is some text"); } ))
+[0002] AddContent("This is some text")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified_WithoutName/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified_WithoutName/TestComponent.builder.txt
new file mode 100644
index 0000000000000..692a76be1ad99
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified_WithoutName/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddAttribute("ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddMarkupContent(2, "Hello World
"); } ))
+[0002] AddMarkupContent("Hello World
")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_NoValueSpecified/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_NoValueSpecified/TestComponent.builder.txt
new file mode 100644
index 0000000000000..81a411a0dfb55
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_NoValueSpecified/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_ValueSpecified/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_ValueSpecified/TestComponent.builder.txt
new file mode 100644
index 0000000000000..68b5698d3ccaa
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_ValueSpecified/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddAttribute("Found", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { __builder2.AddMarkupContent(2, "Here\'s Johnny!
"); } ))
+[0002] AddMarkupContent("Here\'s Johnny!
")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_NoValueSpecified/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_NoValueSpecified/TestComponent.builder.txt
new file mode 100644
index 0000000000000..ced0d8fb881ca
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_NoValueSpecified/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecified/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecified/TestComponent.builder.txt
new file mode 100644
index 0000000000000..3da1418bdd30a
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecified/TestComponent.builder.txt
@@ -0,0 +1,2 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters. Property1 ), "Some Value")
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind/TestComponent.builder.txt
new file mode 100644
index 0000000000000..8729086159dfa
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters. Property1 ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( myField ))
+[0002] AddComponentParameter("Property1Changed", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => myField = __value, myField))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGet/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGet/TestComponent.builder.txt
new file mode 100644
index 0000000000000..8729086159dfa
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGet/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters. Property1 ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( myField ))
+[0002] AddComponentParameter("Property1Changed", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => myField = __value, myField))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGetSet/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGetSet/TestComponent.builder.txt
new file mode 100644
index 0000000000000..6d1bdedef69af
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGetSet/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters. Property1 ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( myField ))
+[0002] AddComponentParameter("Property1Changed", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, OnFieldChanged , myField))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGetSet_EventCallbackRequired/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGetSet_EventCallbackRequired/TestComponent.builder.txt
new file mode 100644
index 0000000000000..ed8c89a0ed04f
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGetSet_EventCallbackRequired/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters. Property1 ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( myField ))
+[0002] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters.Property1Changed), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, OnFieldChanged , myField))))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGetSet_ExpressionRequired/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGetSet_ExpressionRequired/TestComponent.builder.txt
new file mode 100644
index 0000000000000..ab2d84e9d30c6
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindGetSet_ExpressionRequired/TestComponent.builder.txt
@@ -0,0 +1,4 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters. Property1 ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( myField ))
+[0002] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters.Property1Changed), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, OnFieldChanged , myField))))
+[0003] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters.Property1Expression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => myField))
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindSet/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindSet/TestComponent.builder.txt
new file mode 100644
index 0000000000000..ced0d8fb881ca
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBindSet/TestComponent.builder.txt
@@ -0,0 +1 @@
+[0000] OpenComponent()
\ No newline at end of file
diff --git a/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind_EventCallbackRequired/TestComponent.builder.txt b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind_EventCallbackRequired/TestComponent.builder.txt
new file mode 100644
index 0000000000000..215ebcfb0f32e
--- /dev/null
+++ b/src/Razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind_EventCallbackRequired/TestComponent.builder.txt
@@ -0,0 +1,3 @@
+[0000] OpenComponent()
+[0001] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters. Property1 ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( myField ))
+[0002] AddComponentParameter(nameof(global::Test.ComponentWithEditorRequiredParameters.Property1Changed), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck