Fix ModelExpression's in section directive blocks.

- Changed `SectionDirectivePass` to move non-token body nodes from the original `DirectiveIntermediateNode` to the `SectionIntermediateNode`. By doing this there's no longer dual references of `SectionIntermediateNode` bodies.
- Added MVC tests for current and 1_X extensions.

#1614
This commit is contained in:
N. Taylor Mullen 2017-08-14 12:43:56 -07:00
parent 8d2a9e5929
commit db805eb3e3
13 changed files with 291 additions and 76 deletions

View File

@ -35,9 +35,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Extensions
}
}
for (; i < directive.Node.Children.Count; i++)
while (i != directive.Node.Children.Count)
{
// Move non-token children over to the section node so we don't have double references to children nodes.
section.Children.Add(directive.Node.Children[i]);
directive.Node.Children.RemoveAt(i);
}
directive.InsertAfter(section);

View File

@ -109,7 +109,14 @@ public class MyModel
[Fact]
public void Sections_Runtime()
{
var references = CreateCompilationReferences(CurrentMvcShim);
var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@"
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class InputTestTagHelper : {typeof(TagHelper).FullName}
{{
public ModelExpression For {{ get; set; }}
}}
");
RunRuntimeTest(references);
}
@ -351,7 +358,14 @@ public abstract class MyPageModel<T> : Page
[Fact]
public void Sections_DesignTime()
{
var references = CreateCompilationReferences(CurrentMvcShim);
var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@"
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class InputTestTagHelper : {typeof(TagHelper).FullName}
{{
public ModelExpression For {{ get; set; }}
}}
");
RunDesignTimeTest(references);
}

View File

@ -1,4 +1,8 @@
@{
@model DateTime
@addTagHelper "InputTestTagHelper, AppCode"
@{
Layout = "_SectionTestLayout.cshtml";
}
@ -6,4 +10,5 @@
@section Section1 {
<div>This is in Section 1</div>
<input-test for="Date" />
}

View File

@ -11,11 +11,20 @@ namespace AspNetCore
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime>
{
private global::InputTestTagHelper __InputTestTagHelper;
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
((System.Action)(() => {
DateTime __typeHelper = default(DateTime);
}
))();
((System.Action)(() => {
global::System.Object __typeHelper = "InputTestTagHelper, AppCode";
}
))();
((System.Action)(() => {
global::System.Object Section1 = null;
}
))();
@ -27,13 +36,19 @@ global::System.Object Section1 = null;
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml"
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml"
Layout = "_SectionTestLayout.cshtml";
#line default
#line hidden
DefineSection("Section1", async() => {
__InputTestTagHelper = CreateTagHelper<global::InputTestTagHelper>();
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml"
__InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Date);
#line default
#line hidden
}
);
}
@ -47,7 +62,7 @@ global::System.Object Section1 = null;
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<DateTime> Html { get; private set; }
}
}
#pragma warning restore 1591

View File

@ -8,7 +8,9 @@ Document -
UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime> -
DefaultTagHelperRuntime -
FieldDeclaration - - private - global::InputTestTagHelper - __InputTestTagHelper
DesignTimeDirective -
DirectiveToken - (231:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (294:7,71 [4] ) - Html
@ -23,7 +25,9 @@ Document -
DirectiveToken - (617:12,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (729:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (832:14,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (86:6,9 [8] Sections.cshtml) - Section1
DirectiveToken - (7:0,7 [8] Sections.cshtml) - DateTime
DirectiveToken - (33:2,14 [29] Sections.cshtml) - "InputTestTagHelper, AppCode"
DirectiveToken - (152:10,9 [8] Sections.cshtml) - Section1
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
@ -31,21 +35,37 @@ Document -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync
CSharpCode - (2:0,2 [46] Sections.cshtml)
IntermediateToken - (2:0,2 [46] Sections.cshtml) - CSharp - \n Layout = "_SectionTestLayout.cshtml";\n
HtmlContent - (51:3,0 [26] Sections.cshtml)
IntermediateToken - (51:3,0 [2] Sections.cshtml) - Html - \n
IntermediateToken - (53:4,0 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (58:4,5 [9] Sections.cshtml) - Html - Some body
IntermediateToken - (67:4,14 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (73:4,20 [4] Sections.cshtml) - Html - \n\n
HtmlContent - (17:1,0 [2] Sections.cshtml)
IntermediateToken - (17:1,0 [2] Sections.cshtml) - Html - \n
HtmlContent - (62:2,43 [4] Sections.cshtml)
IntermediateToken - (62:2,43 [4] Sections.cshtml) - Html - \n\n
CSharpCode - (68:4,2 [46] Sections.cshtml)
IntermediateToken - (68:4,2 [46] Sections.cshtml) - CSharp - \n Layout = "_SectionTestLayout.cshtml";\n
HtmlContent - (117:7,0 [26] Sections.cshtml)
IntermediateToken - (117:7,0 [2] Sections.cshtml) - Html - \n
IntermediateToken - (119:8,0 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (124:8,5 [9] Sections.cshtml) - Html - Some body
IntermediateToken - (133:8,14 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (139:8,20 [4] Sections.cshtml) - Html - \n\n
Section - - Section1
HtmlContent - (96:6,19 [39] Sections.cshtml)
IntermediateToken - (96:6,19 [6] Sections.cshtml) - Html - \n
IntermediateToken - (102:7,4 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (107:7,9 [20] Sections.cshtml) - Html - This is in Section 1
IntermediateToken - (127:7,29 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (133:7,35 [2] Sections.cshtml) - Html - \n
HtmlContent - (162:10,19 [43] Sections.cshtml)
IntermediateToken - (162:10,19 [6] Sections.cshtml) - Html - \n
IntermediateToken - (168:11,4 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (173:11,9 [20] Sections.cshtml) - Html - This is in Section 1
IntermediateToken - (193:11,29 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (199:11,35 [6] Sections.cshtml) - Html - \n
TagHelper - (205:12,4 [25] Sections.cshtml) - input-test - TagMode.SelfClosing
DefaultTagHelperBody -
DefaultTagHelperCreate - - InputTestTagHelper
DefaultTagHelperProperty - (222:12,21 [4] Sections.cshtml) - for - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression InputTestTagHelper.For - HtmlAttributeValueStyle.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - ModelExpressionProvider.CreateModelExpression(ViewData, __model =>
IntermediateToken - - CSharp - __model.
IntermediateToken - (222:12,21 [4] Sections.cshtml) - CSharp - Date
IntermediateToken - - CSharp - )
DefaultTagHelperExecute -
HtmlContent - (230:12,29 [2] Sections.cshtml)
IntermediateToken - (230:12,29 [2] Sections.cshtml) - Html - \n
Inject -
Inject -
Inject -

View File

@ -1,14 +1,29 @@
Source Location: (86:6,9 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
Source Location: (7:0,7 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|DateTime|
Generated Location: (742:19,0 [8] )
|DateTime|
Source Location: (33:2,14 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|"InputTestTagHelper, AppCode"|
Generated Location: (883:23,37 [29] )
|"InputTestTagHelper, AppCode"|
Source Location: (152:10,9 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|Section1|
Generated Location: (697:18,22 [8] )
Generated Location: (997:27,22 [8] )
|Section1|
Source Location: (2:0,2 [46] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
Source Location: (68:4,2 [46] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|
Layout = "_SectionTestLayout.cshtml";
|
Generated Location: (1132:30,2 [46] )
Generated Location: (1432:39,2 [46] )
|
Layout = "_SectionTestLayout.cshtml";
|
Source Location: (222:12,21 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|Date|
Generated Location: (1835:47,102 [4] )
|Date|

View File

@ -1,4 +1,4 @@
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "c7635d54fa83ccf10a29be2f0a7b56d1703398a7"
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "dbec91fd88a09c6a2e35b5adedb3f8ab8e3ae486"
// <auto-generated/>
#pragma warning disable 1591
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml))]
@ -12,23 +12,71 @@ namespace AspNetCore
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime>
{
#line hidden
#pragma warning disable 0169
private string __tagHelperStringValueBuffer;
#pragma warning restore 0169
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext;
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner();
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null;
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager
{
get
{
if (__backed__tagHelperScopeManager == null)
{
__backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
}
return __backed__tagHelperScopeManager;
}
}
private global::InputTestTagHelper __InputTestTagHelper;
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml"
BeginContext(17, 2, true);
WriteLiteral("\r\n");
EndContext();
BeginContext(64, 2, true);
WriteLiteral("\r\n");
EndContext();
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml"
Layout = "_SectionTestLayout.cshtml";
#line default
#line hidden
BeginContext(51, 26, true);
BeginContext(117, 26, true);
WriteLiteral("\r\n<div>Some body</div>\r\n\r\n");
EndContext();
DefineSection("Section1", async() => {
BeginContext(96, 39, true);
WriteLiteral("\r\n <div>This is in Section 1</div>\r\n");
BeginContext(162, 43, true);
WriteLiteral("\r\n <div>This is in Section 1</div>\r\n ");
EndContext();
BeginContext(205, 25, false);
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => {
}
);
__InputTestTagHelper = CreateTagHelper<global::InputTestTagHelper>();
__tagHelperExecutionContext.Add(__InputTestTagHelper);
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml"
__InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Date);
#line default
#line hidden
__tagHelperExecutionContext.AddTagHelperAttribute("for", __InputTestTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
EndContext();
BeginContext(230, 2, true);
WriteLiteral("\r\n");
EndContext();
}
);
@ -43,7 +91,7 @@ namespace AspNetCore
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<DateTime> Html { get; private set; }
}
}
#pragma warning restore 1591

View File

@ -9,29 +9,63 @@ Document -
UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc
UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime> -
DefaultTagHelperRuntime -
FieldDeclaration - - private - global::InputTestTagHelper - __InputTestTagHelper
MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync
CSharpCode - (2:0,2 [46] Sections.cshtml)
IntermediateToken - (2:0,2 [46] Sections.cshtml) - CSharp - \n Layout = "_SectionTestLayout.cshtml";\n
CSharpCode -
IntermediateToken - - CSharp - BeginContext(51, 26, true);
HtmlContent - (51:3,0 [26] Sections.cshtml)
IntermediateToken - (51:3,0 [2] Sections.cshtml) - Html - \n
IntermediateToken - (53:4,0 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (58:4,5 [9] Sections.cshtml) - Html - Some body
IntermediateToken - (67:4,14 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (73:4,20 [4] Sections.cshtml) - Html - \n\n
IntermediateToken - - CSharp - BeginContext(17, 2, true);
HtmlContent - (17:1,0 [2] Sections.cshtml)
IntermediateToken - (17:1,0 [2] Sections.cshtml) - Html - \n
CSharpCode -
IntermediateToken - - CSharp - EndContext();
CSharpCode -
IntermediateToken - - CSharp - BeginContext(64, 2, true);
HtmlContent - (64:3,0 [2] Sections.cshtml)
IntermediateToken - (64:3,0 [2] Sections.cshtml) - Html - \n
CSharpCode -
IntermediateToken - - CSharp - EndContext();
CSharpCode - (68:4,2 [46] Sections.cshtml)
IntermediateToken - (68:4,2 [46] Sections.cshtml) - CSharp - \n Layout = "_SectionTestLayout.cshtml";\n
CSharpCode -
IntermediateToken - - CSharp - BeginContext(117, 26, true);
HtmlContent - (117:7,0 [26] Sections.cshtml)
IntermediateToken - (117:7,0 [2] Sections.cshtml) - Html - \n
IntermediateToken - (119:8,0 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (124:8,5 [9] Sections.cshtml) - Html - Some body
IntermediateToken - (133:8,14 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (139:8,20 [4] Sections.cshtml) - Html - \n\n
CSharpCode -
IntermediateToken - - CSharp - EndContext();
Section - - Section1
CSharpCode -
IntermediateToken - - CSharp - BeginContext(96, 39, true);
HtmlContent - (96:6,19 [39] Sections.cshtml)
IntermediateToken - (96:6,19 [6] Sections.cshtml) - Html - \n
IntermediateToken - (102:7,4 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (107:7,9 [20] Sections.cshtml) - Html - This is in Section 1
IntermediateToken - (127:7,29 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (133:7,35 [2] Sections.cshtml) - Html - \n
IntermediateToken - - CSharp - BeginContext(162, 43, true);
HtmlContent - (162:10,19 [43] Sections.cshtml)
IntermediateToken - (162:10,19 [6] Sections.cshtml) - Html - \n
IntermediateToken - (168:11,4 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (173:11,9 [20] Sections.cshtml) - Html - This is in Section 1
IntermediateToken - (193:11,29 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (199:11,35 [6] Sections.cshtml) - Html - \n
CSharpCode -
IntermediateToken - - CSharp - EndContext();
CSharpCode -
IntermediateToken - - CSharp - BeginContext(205, 25, false);
TagHelper - (205:12,4 [25] Sections.cshtml) - input-test - TagMode.SelfClosing
DefaultTagHelperBody -
DefaultTagHelperCreate - - InputTestTagHelper
DefaultTagHelperProperty - (222:12,21 [4] Sections.cshtml) - for - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression InputTestTagHelper.For - HtmlAttributeValueStyle.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - ModelExpressionProvider.CreateModelExpression(ViewData, __model =>
IntermediateToken - - CSharp - __model.
IntermediateToken - (222:12,21 [4] Sections.cshtml) - CSharp - Date
IntermediateToken - - CSharp - )
DefaultTagHelperExecute -
CSharpCode -
IntermediateToken - - CSharp - EndContext();
CSharpCode -
IntermediateToken - - CSharp - BeginContext(230, 2, true);
HtmlContent - (230:12,29 [2] Sections.cshtml)
IntermediateToken - (230:12,29 [2] Sections.cshtml) - Html - \n
CSharpCode -
IntermediateToken - - CSharp - EndContext();
Inject -

View File

@ -103,7 +103,14 @@ public class MyModel
[Fact]
public void Sections_DesignTime()
{
var references = CreateCompilationReferences(CurrentMvcShim);
var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@"
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class InputTestTagHelper : {typeof(TagHelper).FullName}
{{
public ModelExpression For {{ get; set; }}
}}
");
RunDesignTimeTest(references);
}

View File

@ -1,4 +1,8 @@
@{
@model DateTime
@addTagHelper "InputTestTagHelper, AppCode"
@{
Layout = "_SectionTestLayout.cshtml";
}
@ -6,4 +10,5 @@
@section Section1 {
<div>This is in Section 1</div>
<input-test for="Date" />
}

View File

@ -11,11 +11,20 @@ namespace AspNetCore
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime>
{
private global::InputTestTagHelper __InputTestTagHelper;
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
((System.Action)(() => {
DateTime __typeHelper = default(DateTime);
}
))();
((System.Action)(() => {
global::System.Object __typeHelper = "InputTestTagHelper, AppCode";
}
))();
((System.Action)(() => {
global::System.Object Section1 = null;
}
))();
@ -27,13 +36,19 @@ global::System.Object Section1 = null;
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml"
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml"
Layout = "_SectionTestLayout.cshtml";
#line default
#line hidden
DefineSection("Section1", async(__razor_section_writer) => {
__InputTestTagHelper = CreateTagHelper<global::InputTestTagHelper>();
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml"
__InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Date);
#line default
#line hidden
}
);
}
@ -47,7 +62,7 @@ global::System.Object Section1 = null;
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<DateTime> Html { get; private set; }
}
}
#pragma warning restore 1591

View File

@ -8,7 +8,9 @@ Document -
UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc
UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime> -
DefaultTagHelperRuntime -
FieldDeclaration - - private - global::InputTestTagHelper - __InputTestTagHelper
DesignTimeDirective -
DirectiveToken - (231:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
DirectiveToken - (294:7,71 [4] ) - Html
@ -21,7 +23,9 @@ Document -
DirectiveToken - (507:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
DirectiveToken - (578:11,79 [23] ) - ModelExpressionProvider
DirectiveToken - (617:12,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
DirectiveToken - (86:6,9 [8] Sections.cshtml) - Section1
DirectiveToken - (7:0,7 [8] Sections.cshtml) - DateTime
DirectiveToken - (33:2,14 [29] Sections.cshtml) - "InputTestTagHelper, AppCode"
DirectiveToken - (152:10,9 [8] Sections.cshtml) - Section1
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
@ -29,21 +33,37 @@ Document -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync
CSharpCode - (2:0,2 [46] Sections.cshtml)
IntermediateToken - (2:0,2 [46] Sections.cshtml) - CSharp - \n Layout = "_SectionTestLayout.cshtml";\n
HtmlContent - (51:3,0 [26] Sections.cshtml)
IntermediateToken - (51:3,0 [2] Sections.cshtml) - Html - \n
IntermediateToken - (53:4,0 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (58:4,5 [9] Sections.cshtml) - Html - Some body
IntermediateToken - (67:4,14 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (73:4,20 [4] Sections.cshtml) - Html - \n\n
HtmlContent - (17:1,0 [2] Sections.cshtml)
IntermediateToken - (17:1,0 [2] Sections.cshtml) - Html - \n
HtmlContent - (62:2,43 [4] Sections.cshtml)
IntermediateToken - (62:2,43 [4] Sections.cshtml) - Html - \n\n
CSharpCode - (68:4,2 [46] Sections.cshtml)
IntermediateToken - (68:4,2 [46] Sections.cshtml) - CSharp - \n Layout = "_SectionTestLayout.cshtml";\n
HtmlContent - (117:7,0 [26] Sections.cshtml)
IntermediateToken - (117:7,0 [2] Sections.cshtml) - Html - \n
IntermediateToken - (119:8,0 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (124:8,5 [9] Sections.cshtml) - Html - Some body
IntermediateToken - (133:8,14 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (139:8,20 [4] Sections.cshtml) - Html - \n\n
Section - - Section1
HtmlContent - (96:6,19 [39] Sections.cshtml)
IntermediateToken - (96:6,19 [6] Sections.cshtml) - Html - \n
IntermediateToken - (102:7,4 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (107:7,9 [20] Sections.cshtml) - Html - This is in Section 1
IntermediateToken - (127:7,29 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (133:7,35 [2] Sections.cshtml) - Html - \n
HtmlContent - (162:10,19 [43] Sections.cshtml)
IntermediateToken - (162:10,19 [6] Sections.cshtml) - Html - \n
IntermediateToken - (168:11,4 [5] Sections.cshtml) - Html - <div>
IntermediateToken - (173:11,9 [20] Sections.cshtml) - Html - This is in Section 1
IntermediateToken - (193:11,29 [6] Sections.cshtml) - Html - </div>
IntermediateToken - (199:11,35 [6] Sections.cshtml) - Html - \n
TagHelper - (205:12,4 [25] Sections.cshtml) - input-test - TagMode.SelfClosing
DefaultTagHelperBody -
DefaultTagHelperCreate - - InputTestTagHelper
DefaultTagHelperProperty - (222:12,21 [4] Sections.cshtml) - for - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression InputTestTagHelper.For - HtmlAttributeValueStyle.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - ModelExpressionProvider.CreateModelExpression(ViewData, __model =>
IntermediateToken - - CSharp - __model.
IntermediateToken - (222:12,21 [4] Sections.cshtml) - CSharp - Date
IntermediateToken - - CSharp - )
DefaultTagHelperExecute -
HtmlContent - (230:12,29 [2] Sections.cshtml)
IntermediateToken - (230:12,29 [2] Sections.cshtml) - Html - \n
Inject -
Inject -
Inject -

View File

@ -1,14 +1,29 @@
Source Location: (86:6,9 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
Source Location: (7:0,7 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|DateTime|
Generated Location: (742:19,0 [8] )
|DateTime|
Source Location: (33:2,14 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|"InputTestTagHelper, AppCode"|
Generated Location: (883:23,37 [29] )
|"InputTestTagHelper, AppCode"|
Source Location: (152:10,9 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|Section1|
Generated Location: (697:18,22 [8] )
Generated Location: (997:27,22 [8] )
|Section1|
Source Location: (2:0,2 [46] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
Source Location: (68:4,2 [46] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|
Layout = "_SectionTestLayout.cshtml";
|
Generated Location: (1132:30,2 [46] )
Generated Location: (1432:39,2 [46] )
|
Layout = "_SectionTestLayout.cshtml";
|
Source Location: (222:12,21 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml)
|Date|
Generated Location: (1857:47,102 [4] )
|Date|