Add CodeGen tests for @inherits
This commit is contained in:
parent
dc66eabbff
commit
8af9f656dd
|
|
@ -5,7 +5,6 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.Language.IntegrationTests;
|
||||
|
|
@ -24,6 +23,35 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests
|
|||
private static readonly RazorSourceDocument DefaultImports = MvcRazorTemplateEngine.GetDefaultImports();
|
||||
|
||||
#region Runtime
|
||||
[Fact]
|
||||
public void InheritsViewModel_Runtime()
|
||||
{
|
||||
// Arrange
|
||||
var engine = CreateDesignTimeEngine();
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertIRMatchesBaseline(document.GetIRDocument());
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InheritsWithViewImports_Runtime()
|
||||
{
|
||||
// Arrange
|
||||
var engine = CreateDesignTimeEngine();
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertIRMatchesBaseline(document.GetIRDocument());
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MalformedPageDirective_Runtime()
|
||||
|
|
@ -208,6 +236,36 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests
|
|||
|
||||
#region DesignTime
|
||||
|
||||
[Fact]
|
||||
public void InheritsViewModel_DesignTime()
|
||||
{
|
||||
// Arrange
|
||||
var engine = CreateDesignTimeEngine();
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertIRMatchesBaseline(document.GetIRDocument());
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InheritsWithViewImports_DesignTime()
|
||||
{
|
||||
// Arrange
|
||||
var engine = CreateDesignTimeEngine();
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertIRMatchesBaseline(document.GetIRDocument());
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MalformedPageDirective_DesignTime()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
@inherits MyBasePageForViews<TModel>
|
||||
@model MyModel
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = global::System.Object;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel_cshtml : MyBasePageForViews<MyModel>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
MyBasePageForViews<TModel> __typeHelper = null;
|
||||
}
|
||||
))();
|
||||
((System.Action)(() => {
|
||||
MyModel __typeHelper = null;
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
|
||||
[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<MyModel> Html { get; private set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
Document -
|
||||
Checksum -
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
UsingStatement - - System.Threading.Tasks
|
||||
UsingStatement - (16:1,1 [17] ) - System.Linq
|
||||
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
|
||||
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
|
||||
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
|
||||
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel_cshtml - MyBasePageForViews<MyModel> -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
|
||||
DirectiveToken - (263:6,71 [4] ) - Html
|
||||
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
|
||||
DirectiveToken - (332:7,63 [4] ) - Json
|
||||
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
|
||||
DirectiveToken - (400:8,62 [9] ) - Component
|
||||
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
|
||||
DirectiveToken - (463:9,52 [3] ) - Url
|
||||
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
|
||||
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
|
||||
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (10:0,10 [26] InheritsViewModel.cshtml) - MyBasePageForViews<TModel>
|
||||
DirectiveToken - (45:1,7 [7] InheritsViewModel.cshtml) - MyModel
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - private static System.Object __o = null;
|
||||
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = global::System.Object;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel_cshtml : MyBasePageForViews<MyModel>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
MyBasePageForViews<TModel> __typeHelper = null;
|
||||
}
|
||||
))();
|
||||
((System.Action)(() => {
|
||||
MyModel __typeHelper = null;
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
|
||||
[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<MyModel> Html { get; private set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
Document -
|
||||
Checksum -
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
UsingStatement - - System.Threading.Tasks
|
||||
UsingStatement - (16:1,1 [17] ) - System.Linq
|
||||
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
|
||||
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
|
||||
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
|
||||
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel_cshtml - MyBasePageForViews<MyModel> -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
|
||||
DirectiveToken - (263:6,71 [4] ) - Html
|
||||
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
|
||||
DirectiveToken - (332:7,63 [4] ) - Json
|
||||
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
|
||||
DirectiveToken - (400:8,62 [9] ) - Component
|
||||
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
|
||||
DirectiveToken - (463:9,52 [3] ) - Url
|
||||
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
|
||||
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
|
||||
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (10:0,10 [26] InheritsViewModel.cshtml) - MyBasePageForViews<TModel>
|
||||
DirectiveToken - (45:1,7 [7] InheritsViewModel.cshtml) - MyModel
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - private static System.Object __o = null;
|
||||
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
@page
|
||||
@model MyModel
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = global::System.Object;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports_cshtml : MyPageModel<MyModel>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
MyModel __typeHelper = null;
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
|
||||
[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<MyModel> Html { get; private set; }
|
||||
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<MyModel> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<MyModel>)PageContext?.ViewData;
|
||||
public MyModel Model => ViewData.Model;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
Document -
|
||||
Checksum -
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
UsingStatement - - System.Threading.Tasks
|
||||
UsingStatement - (16:1,1 [17] ) - System.Linq
|
||||
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
|
||||
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
|
||||
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
|
||||
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports_cshtml - MyPageModel<MyModel> -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (10:0,10 [19] InheritsWithViewImports_Imports0.cshtml) - MyPageModel<TModel>
|
||||
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
|
||||
DirectiveToken - (263:6,71 [4] ) - Html
|
||||
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
|
||||
DirectiveToken - (332:7,63 [4] ) - Json
|
||||
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
|
||||
DirectiveToken - (400:8,62 [9] ) - Component
|
||||
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
|
||||
DirectiveToken - (463:9,52 [3] ) - Url
|
||||
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
|
||||
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
|
||||
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (14:1,7 [7] InheritsWithViewImports.cshtml) - MyModel
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - private static System.Object __o = null;
|
||||
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<MyModel> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<MyModel>)PageContext?.ViewData;
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - public MyModel Model => ViewData.Model;
|
||||
|
|
@ -0,0 +1 @@
|
|||
@inherits MyPageModel<TModel>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = global::System.Object;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports_cshtml : MyPageModel<MyModel>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
MyModel __typeHelper = null;
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
|
||||
[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<MyModel> Html { get; private set; }
|
||||
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<MyModel> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<MyModel>)PageContext?.ViewData;
|
||||
public MyModel Model => ViewData.Model;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
Document -
|
||||
Checksum -
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
UsingStatement - - System.Threading.Tasks
|
||||
UsingStatement - (16:1,1 [17] ) - System.Linq
|
||||
UsingStatement - (36:2,1 [32] ) - System.Collections.Generic
|
||||
UsingStatement - (71:3,1 [30] ) - Microsoft.AspNetCore.Mvc
|
||||
UsingStatement - (104:4,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
|
||||
UsingStatement - (147:5,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports_cshtml - MyPageModel<MyModel> -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (10:0,10 [19] InheritsWithViewImports_Imports0.cshtml) - MyPageModel<TModel>
|
||||
DirectiveToken - (200:6,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
|
||||
DirectiveToken - (263:6,71 [4] ) - Html
|
||||
DirectiveToken - (277:7,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
|
||||
DirectiveToken - (332:7,63 [4] ) - Json
|
||||
DirectiveToken - (346:8,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
|
||||
DirectiveToken - (400:8,62 [9] ) - Component
|
||||
DirectiveToken - (419:9,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
|
||||
DirectiveToken - (463:9,52 [3] ) - Url
|
||||
DirectiveToken - (476:10,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
|
||||
DirectiveToken - (547:10,79 [23] ) - ModelExpressionProvider
|
||||
DirectiveToken - (586:11,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (698:12,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (801:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (14:1,7 [7] InheritsWithViewImports.cshtml) - MyModel
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - private static System.Object __o = null;
|
||||
RazorMethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<MyModel> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<MyModel>)PageContext?.ViewData;
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - public MyModel Model => ViewData.Model;
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
@foo()
|
||||
|
||||
@inherits foo.bar<baz<biz>>.boz bar
|
||||
@inherits foo.bar<baz<biz>>.boz
|
||||
|
|
|
|||
|
|
@ -13,5 +13,3 @@ Document -
|
|||
RazorIRToken - (1:0,1 [5] Inherits.cshtml) - CSharp - foo()
|
||||
HtmlContent - (6:0,6 [4] Inherits.cshtml)
|
||||
RazorIRToken - (6:0,6 [4] Inherits.cshtml) - Html - \n\n
|
||||
HtmlContent - (42:2,32 [5] Inherits.cshtml)
|
||||
RazorIRToken - (42:2,32 [5] Inherits.cshtml) - Html - bar\n
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "72d6e21c6366f99a17c63abebb46db3470f4d1da"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "081d0c0715ffeacf3f97a2f3a8443e1e47346419"
|
||||
namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
|
|
@ -15,7 +15,6 @@ Write(foo());
|
|||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n\r\n");
|
||||
WriteLiteral("bar\r\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,5 +9,3 @@ Document -
|
|||
RazorIRToken - (1:0,1 [5] Inherits.cshtml) - CSharp - foo()
|
||||
HtmlContent - (6:0,6 [4] Inherits.cshtml)
|
||||
RazorIRToken - (6:0,6 [4] Inherits.cshtml) - Html - \n\n
|
||||
HtmlContent - (42:2,32 [5] Inherits.cshtml)
|
||||
RazorIRToken - (42:2,32 [5] Inherits.cshtml) - Html - bar\n
|
||||
|
|
|
|||
Loading…
Reference in New Issue