diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentDesignTimeNodeWriter.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentDesignTimeNodeWriter.cs
index 7885d47f8e..ae81506bc6 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentDesignTimeNodeWriter.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentDesignTimeNodeWriter.cs
@@ -874,7 +874,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
// errors will be equivalent
var captureTypeName = node.IsComponentCapture
? node.ComponentCaptureTypeName
- : ComponentsApi.ElementRef.FullTypeName;
+ : ComponentsApi.ElementReference.FullTypeName;
WriteCSharpCode(context, new CSharpCodeIntermediateNode
{
Source = node.Source,
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentRuntimeNodeWriter.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentRuntimeNodeWriter.cs
index 418aa160f5..3e41b668a2 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentRuntimeNodeWriter.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentRuntimeNodeWriter.cs
@@ -792,7 +792,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
//
// builder.AddComponentReferenceCapture(2, (__value) = { _field = (MyComponent)__value; });
// OR
- // builder.AddElementReferenceCapture(2, (__value) = { _field = (ElementRef)__value; });
+ // builder.AddElementReferenceCapture(2, (__value) = { _field = (ElementReference)__value; });
var codeWriter = context.CodeWriter;
var methodName = node.IsComponentCapture
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentsApi.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentsApi.cs
index 9ca5c2795c..9a6aad2cf2 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentsApi.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentsApi.cs
@@ -123,9 +123,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
public static readonly string FullTypeName = "Microsoft.AspNetCore.Components.EventHandlerAttribute";
}
- public static class ElementRef
+ public static class ElementReference
{
- public static readonly string FullTypeName = "Microsoft.AspNetCore.Components.ElementRef";
+ public static readonly string FullTypeName = "Microsoft.AspNetCore.Components.ElementReference";
}
public static class EventCallback
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Intermediate/ReferenceCaptureIntermediateNode.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Intermediate/ReferenceCaptureIntermediateNode.cs
index 077bd0c1fa..48e6bc7d03 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Intermediate/ReferenceCaptureIntermediateNode.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Intermediate/ReferenceCaptureIntermediateNode.cs
@@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate
public string ComponentCaptureTypeName { get; set; }
- public string FieldTypeName => IsComponentCapture ? ComponentCaptureTypeName : "global::" + ComponentsApi.ElementRef.FullTypeName;
+ public string FieldTypeName => IsComponentCapture ? ComponentCaptureTypeName : "global::" + ComponentsApi.ElementReference.FullTypeName;
public string TypeName => $"global::System.Action<{FieldTypeName}>";
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs
index b65d268ac1..365b4f2624 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs
@@ -3742,7 +3742,7 @@ namespace Test
var generated = CompileToCSharp(@"
Hello
@code {
- ElementRef myElem;
+ ElementReference myElem;
void DoStuff() { GC.KeepAlive(myElem); }
}");
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs
index b3e35fd973..2748afdd0f 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs
@@ -82,7 +82,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
// Assert
var field = component.GetType().GetField("myDiv", BindingFlags.NonPublic | BindingFlags.Instance);
Assert.NotNull(field);
- Assert.Same(typeof(ElementRef), field.FieldType);
+ Assert.Same(typeof(ElementReference), field.FieldType);
}
[Fact]
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.codegen.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.codegen.cs
index c74b523370..fae58f00ac 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.codegen.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.codegen.cs
@@ -12,7 +12,7 @@ namespace Test
{
#pragma warning disable 0414
#pragma warning disable 0169
- private global::Microsoft.AspNetCore.Components.ElementRef myElem;
+ private global::Microsoft.AspNetCore.Components.ElementReference myElem;
#pragma warning restore 0169
#pragma warning restore 0414
#pragma warning disable 219
@@ -27,7 +27,7 @@ namespace Test
{
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
- myElem = default(Microsoft.AspNetCore.Components.ElementRef);
+ myElem = default(Microsoft.AspNetCore.Components.ElementReference);
#line default
#line hidden
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt
index d88a3bbec3..c321049510 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt
@@ -6,7 +6,7 @@ Document -
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
- FieldDeclaration - - private - global::Microsoft.AspNetCore.Components.ElementRef - myElem
+ FieldDeclaration - - private - global::Microsoft.AspNetCore.Components.ElementReference - myElem
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.mappings.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.mappings.txt
index 64a2a111d5..2eb6a03840 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.mappings.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef/TestComponent.mappings.txt
@@ -1,5 +1,5 @@
Source Location: (37:0,37 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|myElem|
-Generated Location: (1108:29,37 [6] )
+Generated Location: (1114:29,37 [6] )
|myElem|
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.codegen.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.codegen.cs
index e535ca1ae9..9d01631d68 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.codegen.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.codegen.cs
@@ -12,7 +12,7 @@ namespace Test
{
#pragma warning disable 0414
#pragma warning disable 0169
- private global::Microsoft.AspNetCore.Components.ElementRef _element;
+ private global::Microsoft.AspNetCore.Components.ElementReference _element;
#pragma warning restore 0169
#pragma warning restore 0414
#pragma warning disable 219
@@ -36,7 +36,7 @@ namespace Test
;
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
- _element = default(Microsoft.AspNetCore.Components.ElementRef);
+ _element = default(Microsoft.AspNetCore.Components.ElementReference);
#line default
#line hidden
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt
index 5ebf20fbf2..647bf2d50e 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt
@@ -6,7 +6,7 @@ Document -
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
- FieldDeclaration - - private - global::Microsoft.AspNetCore.Components.ElementRef - _element
+ FieldDeclaration - - private - global::Microsoft.AspNetCore.Components.ElementReference - _element
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.mappings.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.mappings.txt
index e5bbc4a62f..89ac6be30d 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.mappings.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.mappings.txt
@@ -1,18 +1,18 @@
Source Location: (37:0,37 [3] x:\dir\subdir\Test\TestComponent.cshtml)
|Min|
-Generated Location: (1130:30,37 [3] )
+Generated Location: (1136:30,37 [3] )
|Min|
Source Location: (49:0,49 [8] x:\dir\subdir\Test\TestComponent.cshtml)
|_element|
-Generated Location: (1319:38,49 [8] )
+Generated Location: (1325:38,49 [8] )
|_element|
Source Location: (72:2,7 [56] x:\dir\subdir\Test\TestComponent.cshtml)
|
[Parameter] public int Min { get; set; }
|
-Generated Location: (1560:47,7 [56] )
+Generated Location: (1572:47,7 [56] )
|
[Parameter] public int Min { get; set; }
|
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.codegen.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.codegen.cs
index c1596ddf4a..4d2be5537a 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.codegen.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.codegen.cs
@@ -22,7 +22,7 @@ namespace Test
{
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
- myElem = default(Microsoft.AspNetCore.Components.ElementRef);
+ myElem = default(Microsoft.AspNetCore.Components.ElementReference);
#line default
#line hidden
@@ -32,7 +32,7 @@ namespace Test
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
- ElementRef myElem;
+ ElementReference myElem;
void DoStuff() { GC.KeepAlive(myElem); }
#line default
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.ir.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.ir.txt
index 5cb785f84e..e505e82004 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.ir.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.ir.txt
@@ -20,5 +20,5 @@ Document -
ReferenceCapture - (12:0,12 [6] x:\dir\subdir\Test\TestComponent.cshtml) - myElem
HtmlContent - (51:0,51 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (51:0,51 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
- CSharpCode - (60:1,7 [72] x:\dir\subdir\Test\TestComponent.cshtml)
- IntermediateToken - (60:1,7 [72] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n ElementRef myElem;\n void DoStuff() { GC.KeepAlive(myElem); }\n
+ CSharpCode - (60:1,7 [78] x:\dir\subdir\Test\TestComponent.cshtml)
+ IntermediateToken - (60:1,7 [78] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n ElementReference myElem;\n void DoStuff() { GC.KeepAlive(myElem); }\n
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.mappings.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.mappings.txt
index a4beb28484..a4e15f2c64 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.mappings.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.mappings.txt
@@ -3,14 +3,14 @@ Source Location: (12:0,12 [6] x:\dir\subdir\Test\TestComponent.cshtml)
Generated Location: (855:24,12 [6] )
|myElem|
-Source Location: (60:1,7 [72] x:\dir\subdir\Test\TestComponent.cshtml)
+Source Location: (60:1,7 [78] x:\dir\subdir\Test\TestComponent.cshtml)
|
- ElementRef myElem;
+ ElementReference myElem;
void DoStuff() { GC.KeepAlive(myElem); }
|
-Generated Location: (1094:33,7 [72] )
+Generated Location: (1100:33,7 [78] )
|
- ElementRef myElem;
+ ElementReference myElem;
void DoStuff() { GC.KeepAlive(myElem); }
|
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.codegen.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.codegen.cs
index 1dacb96fe0..ff782ad029 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.codegen.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.codegen.cs
@@ -12,7 +12,7 @@ namespace Test
{
#pragma warning disable 0414
#pragma warning disable 0169
- private global::Microsoft.AspNetCore.Components.ElementRef myElem;
+ private global::Microsoft.AspNetCore.Components.ElementReference myElem;
#pragma warning restore 0169
#pragma warning restore 0414
#pragma warning disable 1998
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt
index 7acd3547a4..c51872c53f 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt
@@ -6,7 +6,7 @@ Document -
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
- FieldDeclaration - - private - global::Microsoft.AspNetCore.Components.ElementRef - myElem
+ FieldDeclaration - - private - global::Microsoft.AspNetCore.Components.ElementReference - myElem
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [80] x:\dir\subdir\Test\TestComponent.cshtml) - elem
HtmlContent - (68:0,68 [5] x:\dir\subdir\Test\TestComponent.cshtml)
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.mappings.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.mappings.txt
index 7f14ab1c93..826dab548b 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.mappings.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.mappings.txt
@@ -1,5 +1,5 @@
Source Location: (37:0,37 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|myElem|
-Generated Location: (1083:26,37 [6] )
+Generated Location: (1089:26,37 [6] )
|myElem|
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.codegen.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.codegen.cs
index 85402811d2..f4407667db 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.codegen.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.codegen.cs
@@ -12,7 +12,7 @@ namespace Test
{
#pragma warning disable 0414
#pragma warning disable 0169
- private global::Microsoft.AspNetCore.Components.ElementRef _element;
+ private global::Microsoft.AspNetCore.Components.ElementReference _element;
#pragma warning restore 0169
#pragma warning restore 0414
#pragma warning disable 1998
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt
index cc1e4700ae..c0fd524c30 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt
@@ -6,7 +6,7 @@ Document -
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
- FieldDeclaration - - private - global::Microsoft.AspNetCore.Components.ElementRef - _element
+ FieldDeclaration - - private - global::Microsoft.AspNetCore.Components.ElementReference - _element
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [61] x:\dir\subdir\Test\TestComponent.cshtml) - input
HtmlAttribute - - type=" - "
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.mappings.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.mappings.txt
index e119fa8929..42d48ed927 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.mappings.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.mappings.txt
@@ -1,13 +1,13 @@
Source Location: (49:0,49 [8] x:\dir\subdir\Test\TestComponent.cshtml)
|_element|
-Generated Location: (1255:34,49 [8] )
+Generated Location: (1261:34,49 [8] )
|_element|
Source Location: (72:2,7 [56] x:\dir\subdir\Test\TestComponent.cshtml)
|
[Parameter] public int Min { get; set; }
|
-Generated Location: (1520:46,7 [56] )
+Generated Location: (1526:46,7 [56] )
|
[Parameter] public int Min { get; set; }
|
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.codegen.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.codegen.cs
index 548594ab24..5144ce4e61 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.codegen.cs
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.codegen.cs
@@ -31,7 +31,7 @@ namespace Test
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
- ElementRef myElem;
+ ElementReference myElem;
void DoStuff() { GC.KeepAlive(myElem); }
#line default
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.ir.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.ir.txt
index a92d1e0d9c..89666189e8 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.ir.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.ir.txt
@@ -11,5 +11,5 @@ Document -
HtmlContent - (39:0,39 [5] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (39:0,39 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello
ReferenceCapture - (12:0,12 [6] x:\dir\subdir\Test\TestComponent.cshtml) - myElem
- CSharpCode - (60:1,7 [72] x:\dir\subdir\Test\TestComponent.cshtml)
- IntermediateToken - (60:1,7 [72] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n ElementRef myElem;\n void DoStuff() { GC.KeepAlive(myElem); }\n
+ CSharpCode - (60:1,7 [78] x:\dir\subdir\Test\TestComponent.cshtml)
+ IntermediateToken - (60:1,7 [78] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n ElementReference myElem;\n void DoStuff() { GC.KeepAlive(myElem); }\n
diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.mappings.txt b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.mappings.txt
index 4b1c0546cf..41e1311f24 100644
--- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.mappings.txt
+++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_SuppressField/TestComponent.mappings.txt
@@ -3,14 +3,14 @@ Source Location: (12:0,12 [6] x:\dir\subdir\Test\TestComponent.cshtml)
Generated Location: (698:19,12 [6] )
|myElem|
-Source Location: (60:1,7 [72] x:\dir\subdir\Test\TestComponent.cshtml)
+Source Location: (60:1,7 [78] x:\dir\subdir\Test\TestComponent.cshtml)
|
- ElementRef myElem;
+ ElementReference myElem;
void DoStuff() { GC.KeepAlive(myElem); }
|
-Generated Location: (1006:32,7 [72] )
+Generated Location: (1006:32,7 [78] )
|
- ElementRef myElem;
+ ElementReference myElem;
void DoStuff() { GC.KeepAlive(myElem); }
|
diff --git a/src/Razor/Microsoft.CodeAnalysis.Razor/src/RefTagHelperDescriptorProvider.cs b/src/Razor/Microsoft.CodeAnalysis.Razor/src/RefTagHelperDescriptorProvider.cs
index 7cce7808e6..3dc20da67f 100644
--- a/src/Razor/Microsoft.CodeAnalysis.Razor/src/RefTagHelperDescriptorProvider.cs
+++ b/src/Razor/Microsoft.CodeAnalysis.Razor/src/RefTagHelperDescriptorProvider.cs
@@ -27,8 +27,8 @@ namespace Microsoft.CodeAnalysis.Razor
return;
}
- var elementRef = compilation.GetTypeByMetadataName(ComponentsApi.ElementRef.FullTypeName);
- if (elementRef == null)
+ var elementReference = compilation.GetTypeByMetadataName(ComponentsApi.ElementReference.FullTypeName);
+ if (elementReference == null)
{
// If we can't find ElementRef, then just bail. We won't be able to compile the
// generated code anyway.
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs
index 42a0d20589..a2c69a5b9f 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs
@@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree
[System.Runtime.InteropServices.FieldOffsetAttribute(16)]
public readonly string ElementName;
[System.Runtime.InteropServices.FieldOffsetAttribute(24)]
- public readonly System.Action ElementReferenceCaptureAction;
+ public readonly System.Action ElementReferenceCaptureAction;
[System.Runtime.InteropServices.FieldOffsetAttribute(16)]
public readonly string ElementReferenceCaptureId;
[System.Runtime.InteropServices.FieldOffsetAttribute(8)]
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.cs
index 1af987e156..08b46f7e55 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.cs
@@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Components
protected void OnUnhandledException(System.UnhandledExceptionEventArgs e) { }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
- public readonly partial struct ElementRef
+ public readonly partial struct ElementReference
{
private readonly object _dummy;
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
@@ -719,7 +719,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree
public void AddContent(int sequence, object textContent) { }
public void AddContent(int sequence, string textContent) { }
public void AddContent(int sequence, Microsoft.AspNetCore.Components.RenderFragment fragment, T value) { }
- public void AddElementReferenceCapture(int sequence, System.Action elementReferenceCaptureAction) { }
+ public void AddElementReferenceCapture(int sequence, System.Action elementReferenceCaptureAction) { }
public void AddMarkupContent(int sequence, string markupContent) { }
public void AddMultipleAttributes(int sequence, System.Collections.Generic.IEnumerable> attributes) { }
public void Clear() { }