Suppress compilation errors for TModel in imports
This commit is contained in:
parent
56c2d76e03
commit
0b5113c76e
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
public static IRazorEngineBuilder Register(IRazorEngineBuilder builder)
|
||||
{
|
||||
builder.AddDirective(Directive);
|
||||
builder.Features.Add(new Pass());
|
||||
builder.Features.Add(new Pass(builder.DesignTime));
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
|
@ -58,6 +58,13 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
|
||||
internal class Pass : RazorIRPassBase, IRazorDirectiveClassifierPass
|
||||
{
|
||||
private readonly bool _designTime;
|
||||
|
||||
public Pass(bool designTime)
|
||||
{
|
||||
_designTime = designTime;
|
||||
}
|
||||
|
||||
// Runs after the @inherits directive
|
||||
public override int Order => 5;
|
||||
|
||||
|
|
@ -66,6 +73,19 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
var visitor = new Visitor();
|
||||
var modelType = GetModelType(irDocument, visitor);
|
||||
|
||||
if (_designTime)
|
||||
{
|
||||
// Alias the TModel token to a known type ('object' if the model type is unknown).
|
||||
// This allows design time compilation to succeed for Razor files where the token isn't replaced.
|
||||
var typeName = modelType == "dynamic" ? $"global::{typeof(object).FullName}" : modelType;
|
||||
var usingNode = new UsingStatementIRNode()
|
||||
{
|
||||
Content = $"TModel = {typeName}"
|
||||
};
|
||||
|
||||
visitor.Namespace?.Children.Insert(0, usingNode);
|
||||
}
|
||||
|
||||
var baseType = visitor.Class?.BaseType?.Replace("<TModel>", "<" + modelType + ">");
|
||||
for (var i = visitor.InheritsDirectives.Count - 1; i >= 0; i--)
|
||||
{
|
||||
|
|
@ -85,12 +105,24 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
|
||||
private class Visitor : RazorIRNodeWalker
|
||||
{
|
||||
public NamespaceDeclarationIRNode Namespace { get; private set; }
|
||||
|
||||
public ClassDeclarationIRNode Class { get; private set; }
|
||||
|
||||
public IList<DirectiveIRNode> InheritsDirectives { get; } = new List<DirectiveIRNode>();
|
||||
|
||||
public IList<DirectiveIRNode> ModelDirectives { get; } = new List<DirectiveIRNode>();
|
||||
|
||||
public override void VisitNamespace(NamespaceDeclarationIRNode node)
|
||||
{
|
||||
if (Namespace == null)
|
||||
{
|
||||
Namespace = node;
|
||||
}
|
||||
|
||||
base.VisitNamespace(node);
|
||||
}
|
||||
|
||||
public override void VisitClass(ClassDeclarationIRNode node)
|
||||
{
|
||||
if (Class == null)
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Intermediate;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Legacy;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
");
|
||||
|
||||
var engine = CreateEngine();
|
||||
var pass = new ModelDirective.Pass()
|
||||
var pass = new ModelDirective.Pass(designTime: false)
|
||||
{
|
||||
Engine = engine,
|
||||
};
|
||||
|
|
@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
");
|
||||
|
||||
var engine = CreateEngine();
|
||||
var pass = new ModelDirective.Pass()
|
||||
var pass = new ModelDirective.Pass(designTime: false)
|
||||
{
|
||||
Engine = engine,
|
||||
};
|
||||
|
|
@ -113,7 +113,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
");
|
||||
|
||||
var engine = CreateEngine();
|
||||
var pass = new ModelDirective.Pass()
|
||||
var pass = new ModelDirective.Pass(designTime: false)
|
||||
{
|
||||
Engine = engine,
|
||||
};
|
||||
|
|
@ -138,7 +138,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
");
|
||||
|
||||
var engine = CreateEngine();
|
||||
var pass = new ModelDirective.Pass()
|
||||
var pass = new ModelDirective.Pass(designTime: false)
|
||||
{
|
||||
Engine = engine,
|
||||
};
|
||||
|
|
@ -154,6 +154,65 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
Assert.Equal("BaseType<dynamic>", @class.BaseType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ModelDirectivePass_DesignTime_AddsTModelUsingStatement()
|
||||
{
|
||||
// Arrange
|
||||
var codeDocument = CreateDocument(@"
|
||||
@inherits BaseType<TModel>
|
||||
");
|
||||
|
||||
var engine = CreateEngine();
|
||||
var pass = new ModelDirective.Pass(designTime: true)
|
||||
{
|
||||
Engine = engine,
|
||||
};
|
||||
|
||||
var irDocument = CreateIRDocument(engine, codeDocument);
|
||||
|
||||
// Act
|
||||
pass.Execute(codeDocument, irDocument);
|
||||
|
||||
// Assert
|
||||
var @class = FindClassNode(irDocument);
|
||||
Assert.NotNull(@class);
|
||||
Assert.Equal("BaseType<dynamic>", @class.BaseType);
|
||||
|
||||
var @namespace = FindNamespaceNode(irDocument);
|
||||
var usingNode = Assert.IsType<UsingStatementIRNode>(@namespace.Children[0]);
|
||||
Assert.Equal($"TModel = global::{typeof(object).FullName}", usingNode.Content);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ModelDirectivePass_DesignTime_WithModel_AddsTModelUsingStatement()
|
||||
{
|
||||
// Arrange
|
||||
var codeDocument = CreateDocument(@"
|
||||
@inherits BaseType<TModel>
|
||||
@model SomeType
|
||||
");
|
||||
|
||||
var engine = CreateEngine();
|
||||
var pass = new ModelDirective.Pass(designTime: true)
|
||||
{
|
||||
Engine = engine,
|
||||
};
|
||||
|
||||
var irDocument = CreateIRDocument(engine, codeDocument);
|
||||
|
||||
// Act
|
||||
pass.Execute(codeDocument, irDocument);
|
||||
|
||||
// Assert
|
||||
var @class = FindClassNode(irDocument);
|
||||
Assert.NotNull(@class);
|
||||
Assert.Equal("BaseType<SomeType>", @class.BaseType);
|
||||
|
||||
var @namespace = FindNamespaceNode(irDocument);
|
||||
var usingNode = Assert.IsType<UsingStatementIRNode>(@namespace.Children[0]);
|
||||
Assert.Equal($"TModel = SomeType", usingNode.Content);
|
||||
}
|
||||
|
||||
private RazorCodeDocument CreateDocument(string content)
|
||||
{
|
||||
var source = RazorSourceDocument.Create(content, "test.cshtml");
|
||||
|
|
@ -167,6 +226,13 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
return visitor.Node;
|
||||
}
|
||||
|
||||
private NamespaceDeclarationIRNode FindNamespaceNode(RazorIRNode node)
|
||||
{
|
||||
var visitor = new NamespaceNodeVisitor();
|
||||
visitor.Visit(node);
|
||||
return visitor.Node;
|
||||
}
|
||||
|
||||
private RazorEngine CreateEngine()
|
||||
{
|
||||
return RazorEngine.Create(b =>
|
||||
|
|
@ -216,5 +282,15 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
Node = node;
|
||||
}
|
||||
}
|
||||
|
||||
private class NamespaceNodeVisitor : RazorIRNodeWalker
|
||||
{
|
||||
public NamespaceDeclarationIRNode Node { get; set; }
|
||||
|
||||
public override void VisitNamespace(NamespaceDeclarationIRNode node)
|
||||
{
|
||||
Node = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.Emit;
|
||||
using Microsoft.CodeAnalysis.Razor;
|
||||
using Microsoft.Extensions.DependencyModel;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
||||
|
|
@ -131,13 +130,14 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
});
|
||||
|
||||
var inputContent = ResourceFile.ReadResource(_assembly, inputFile, sourceFile: true);
|
||||
var item = new TestRazorProjectItem(inputFile) { Content = inputContent, };
|
||||
var item = new TestRazorProjectItem("/" + inputFile) { Content = inputContent, };
|
||||
var project = new TestRazorProject(new List<RazorProjectItem>()
|
||||
{
|
||||
item,
|
||||
});
|
||||
|
||||
var razorTemplateEngine = new MvcRazorTemplateEngine(engine, project);
|
||||
razorTemplateEngine.Options.ImportsFileName = "_ViewImports.cshtml";
|
||||
var codeDocument = razorTemplateEngine.CreateCodeDocument(item);
|
||||
codeDocument.Items["SuppressUniqueIds"] = "test";
|
||||
codeDocument.Items["NewLineString"] = "\r\n";
|
||||
|
|
@ -174,13 +174,14 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
});
|
||||
|
||||
var inputContent = ResourceFile.ReadResource(_assembly, inputFile, sourceFile: true);
|
||||
var item = new TestRazorProjectItem(inputFile) { Content = inputContent, };
|
||||
var item = new TestRazorProjectItem("/" + inputFile) { Content = inputContent, };
|
||||
var project = new TestRazorProject(new List<RazorProjectItem>()
|
||||
{
|
||||
item,
|
||||
});
|
||||
|
||||
var razorTemplateEngine = new MvcRazorTemplateEngine(engine, project);
|
||||
razorTemplateEngine.Options.ImportsFileName = "_ViewImports.cshtml";
|
||||
var codeDocument = razorTemplateEngine.CreateCodeDocument(item);
|
||||
codeDocument.Items["SuppressUniqueIds"] = "test";
|
||||
codeDocument.Items["NewLineString"] = "\r\n";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = global::System.Object;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
#line 2 ""
|
||||
|
|
@ -28,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_Basic_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
public class _TestFiles_Input_Basic_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
|
|
@ -82,12 +83,12 @@ System.Object __typeHelper = "Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutio
|
|||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/Input/Basic.cshtml"
|
||||
#line 1 "/TestFiles/Input/Basic.cshtml"
|
||||
__o = logo;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 3 "TestFiles/Input/Basic.cshtml"
|
||||
#line 3 "/TestFiles/Input/Basic.cshtml"
|
||||
__o = Html.Input("SomeKey");
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Source Location: (13:0,13 [4] TestFiles/Input/Basic.cshtml)
|
||||
Source Location: (13:0,13 [4] /TestFiles/Input/Basic.cshtml)
|
||||
|logo|
|
||||
Generated Location: (2325:85,13 [4] )
|
||||
Generated Location: (2370:86,13 [4] )
|
||||
|logo|
|
||||
|
||||
Source Location: (43:2,5 [21] TestFiles/Input/Basic.cshtml)
|
||||
Source Location: (43:2,5 [21] /TestFiles/Input/Basic.cshtml)
|
||||
|Html.Input("SomeKey")|
|
||||
Generated Location: (2409:90,6 [21] )
|
||||
Generated Location: (2455:91,6 [21] )
|
||||
|Html.Input("SomeKey")|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = global::System.Object;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
#line 2 ""
|
||||
|
|
@ -28,12 +29,12 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 1 "TestFiles/Input/Inject.cshtml"
|
||||
#line 1 "/TestFiles/Input/Inject.cshtml"
|
||||
using MyNamespace;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_Inject_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
public class _TestFiles_Input_Inject_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Source Location: (28:1,8 [5] TestFiles/Input/Inject.cshtml)
|
||||
Source Location: (28:1,8 [5] /TestFiles/Input/Inject.cshtml)
|
||||
|MyApp|
|
||||
Generated Location: (2170:84,0 [5] )
|
||||
Generated Location: (2215:85,0 [5] )
|
||||
|MyApp|
|
||||
|
||||
Source Location: (34:1,14 [14] TestFiles/Input/Inject.cshtml)
|
||||
Source Location: (34:1,14 [14] /TestFiles/Input/Inject.cshtml)
|
||||
|MyPropertyName|
|
||||
Generated Location: (2272:88,14 [14] )
|
||||
Generated Location: (2317:89,14 [14] )
|
||||
|MyPropertyName|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = MyModel;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
#line 2 ""
|
||||
|
|
@ -28,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_InjectWithModel_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel>
|
||||
public class _TestFiles_Input_InjectWithModel_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
Source Location: (7:0,7 [7] TestFiles/Input/InjectWithModel.cshtml)
|
||||
Source Location: (7:0,7 [7] /TestFiles/Input/InjectWithModel.cshtml)
|
||||
|MyModel|
|
||||
Generated Location: (2087:79,0 [7] )
|
||||
Generated Location: (2117:80,0 [7] )
|
||||
|MyModel|
|
||||
|
||||
Source Location: (24:1,8 [5] TestFiles/Input/InjectWithModel.cshtml)
|
||||
Source Location: (24:1,8 [5] /TestFiles/Input/InjectWithModel.cshtml)
|
||||
|MyApp|
|
||||
Generated Location: (2177:83,0 [5] )
|
||||
Generated Location: (2207:84,0 [5] )
|
||||
|MyApp|
|
||||
|
||||
Source Location: (30:1,14 [14] TestFiles/Input/InjectWithModel.cshtml)
|
||||
Source Location: (30:1,14 [14] /TestFiles/Input/InjectWithModel.cshtml)
|
||||
|MyPropertyName|
|
||||
Generated Location: (2279:87,14 [14] )
|
||||
Generated Location: (2309:88,14 [14] )
|
||||
|MyPropertyName|
|
||||
|
||||
Source Location: (54:2,8 [17] TestFiles/Input/InjectWithModel.cshtml)
|
||||
Source Location: (54:2,8 [17] /TestFiles/Input/InjectWithModel.cshtml)
|
||||
|MyService<TModel>|
|
||||
Generated Location: (2363:91,0 [17] )
|
||||
Generated Location: (2393:92,0 [17] )
|
||||
|MyService<TModel>|
|
||||
|
||||
Source Location: (72:2,26 [4] TestFiles/Input/InjectWithModel.cshtml)
|
||||
Source Location: (72:2,26 [4] /TestFiles/Input/InjectWithModel.cshtml)
|
||||
|Html|
|
||||
Generated Location: (2477:95,14 [4] )
|
||||
Generated Location: (2507:96,14 [4] )
|
||||
|Html|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = MyModel;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
#line 2 ""
|
||||
|
|
@ -28,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_InjectWithSemicolon_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel>
|
||||
public class _TestFiles_Input_InjectWithSemicolon_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
|
|
|
|||
|
|
@ -1,45 +1,45 @@
|
|||
Source Location: (7:0,7 [7] TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
Source Location: (7:0,7 [7] /TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
|MyModel|
|
||||
Generated Location: (2091:79,0 [7] )
|
||||
Generated Location: (2121:80,0 [7] )
|
||||
|MyModel|
|
||||
|
||||
Source Location: (24:1,8 [5] TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
Source Location: (24:1,8 [5] /TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
|MyApp|
|
||||
Generated Location: (2181:83,0 [5] )
|
||||
Generated Location: (2211:84,0 [5] )
|
||||
|MyApp|
|
||||
|
||||
Source Location: (30:1,14 [14] TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
Source Location: (30:1,14 [14] /TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
|MyPropertyName|
|
||||
Generated Location: (2283:87,14 [14] )
|
||||
Generated Location: (2313:88,14 [14] )
|
||||
|MyPropertyName|
|
||||
|
||||
Source Location: (58:2,8 [17] TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
Source Location: (58:2,8 [17] /TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
|MyService<TModel>|
|
||||
Generated Location: (2367:91,0 [17] )
|
||||
Generated Location: (2397:92,0 [17] )
|
||||
|MyService<TModel>|
|
||||
|
||||
Source Location: (76:2,26 [4] TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
Source Location: (76:2,26 [4] /TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
|Html|
|
||||
Generated Location: (2481:95,14 [4] )
|
||||
Generated Location: (2511:96,14 [4] )
|
||||
|Html|
|
||||
|
||||
Source Location: (93:3,8 [5] TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
Source Location: (93:3,8 [5] /TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
|MyApp|
|
||||
Generated Location: (2555:99,0 [5] )
|
||||
Generated Location: (2585:100,0 [5] )
|
||||
|MyApp|
|
||||
|
||||
Source Location: (99:3,14 [15] TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
Source Location: (99:3,14 [15] /TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
|MyPropertyName2|
|
||||
Generated Location: (2657:103,14 [15] )
|
||||
Generated Location: (2687:104,14 [15] )
|
||||
|MyPropertyName2|
|
||||
|
||||
Source Location: (129:4,8 [17] TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
Source Location: (129:4,8 [17] /TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
|MyService<TModel>|
|
||||
Generated Location: (2742:107,0 [17] )
|
||||
Generated Location: (2772:108,0 [17] )
|
||||
|MyService<TModel>|
|
||||
|
||||
Source Location: (147:4,26 [5] TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
Source Location: (147:4,26 [5] /TestFiles/Input/InjectWithSemicolon.cshtml)
|
||||
|Html2|
|
||||
Generated Location: (2856:111,14 [5] )
|
||||
Generated Location: (2886:112,14 [5] )
|
||||
|Html2|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = System.Collections.IEnumerable;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
#line 2 ""
|
||||
|
|
@ -28,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_Model_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<System.Collections.IEnumerable>
|
||||
public class _TestFiles_Input_Model_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<System.Collections.IEnumerable>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
Source Location: (7:0,7 [30] TestFiles/Input/Model.cshtml)
|
||||
Source Location: (7:0,7 [30] /TestFiles/Input/Model.cshtml)
|
||||
|System.Collections.IEnumerable|
|
||||
Generated Location: (2100:79,0 [30] )
|
||||
Generated Location: (2153:80,0 [30] )
|
||||
|System.Collections.IEnumerable|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = DateTime;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
#line 2 ""
|
||||
|
|
@ -28,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_ModelExpressionTagHelper_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime>
|
||||
public class _TestFiles_Input_ModelExpressionTagHelper_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
|
|
@ -92,13 +93,13 @@ System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTes
|
|||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper>();
|
||||
#line 5 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
#line 5 "/TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Now);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper>();
|
||||
#line 6 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
#line 6 "/TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => Model);
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
Source Location: (7:0,7 [8] TestFiles/Input/ModelExpressionTagHelper.cshtml)
|
||||
Source Location: (7:0,7 [8] /TestFiles/Input/ModelExpressionTagHelper.cshtml)
|
||||
|DateTime|
|
||||
Generated Location: (2097:79,0 [8] )
|
||||
Generated Location: (2128:80,0 [8] )
|
||||
|DateTime|
|
||||
|
||||
Source Location: (33:2,14 [108] TestFiles/Input/ModelExpressionTagHelper.cshtml)
|
||||
Source Location: (33:2,14 [108] /TestFiles/Input/ModelExpressionTagHelper.cshtml)
|
||||
|Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Extensions.Test|
|
||||
Generated Location: (2218:83,30 [108] )
|
||||
Generated Location: (2249:84,30 [108] )
|
||||
|Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Extensions.Test|
|
||||
|
||||
Source Location: (162:4,17 [3] TestFiles/Input/ModelExpressionTagHelper.cshtml)
|
||||
Source Location: (162:4,17 [3] /TestFiles/Input/ModelExpressionTagHelper.cshtml)
|
||||
|Now|
|
||||
Generated Location: (3112:95,144 [3] )
|
||||
Generated Location: (3144:96,144 [3] )
|
||||
|Now|
|
||||
|
||||
Source Location: (189:5,18 [5] TestFiles/Input/ModelExpressionTagHelper.cshtml)
|
||||
Source Location: (189:5,18 [5] /TestFiles/Input/ModelExpressionTagHelper.cshtml)
|
||||
|Model|
|
||||
Generated Location: (3512:101,136 [5] )
|
||||
Generated Location: (3545:102,136 [5] )
|
||||
|Model|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = System.Collections.IEnumerable;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
#line 2 ""
|
||||
|
|
@ -28,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_MultipleModels_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<System.Collections.IEnumerable>
|
||||
public class _TestFiles_Input_MultipleModels_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<System.Collections.IEnumerable>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Source Location: (7:0,7 [21] TestFiles/Input/MultipleModels.cshtml)
|
||||
Source Location: (7:0,7 [21] /TestFiles/Input/MultipleModels.cshtml)
|
||||
|ThisShouldBeGenerated|
|
||||
Generated Location: (2109:79,0 [21] )
|
||||
Generated Location: (2162:80,0 [21] )
|
||||
|ThisShouldBeGenerated|
|
||||
|
||||
Source Location: (37:1,7 [30] TestFiles/Input/MultipleModels.cshtml)
|
||||
Source Location: (37:1,7 [30] /TestFiles/Input/MultipleModels.cshtml)
|
||||
|System.Collections.IEnumerable|
|
||||
Generated Location: (2213:83,0 [30] )
|
||||
Generated Location: (2266:84,0 [30] )
|
||||
|System.Collections.IEnumerable|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = global::System.Object;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
#line 2 ""
|
||||
|
|
@ -28,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input__ViewImports_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
public class _TestFiles_Input__ViewImports_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Source Location: (8:0,8 [19] TestFiles/Input/_ViewImports.cshtml)
|
||||
Source Location: (8:0,8 [19] /TestFiles/Input/_ViewImports.cshtml)
|
||||
|IHtmlHelper<TModel>|
|
||||
Generated Location: (2084:79,0 [19] )
|
||||
Generated Location: (2128:80,0 [19] )
|
||||
|IHtmlHelper<TModel>|
|
||||
|
||||
Source Location: (28:0,28 [5] TestFiles/Input/_ViewImports.cshtml)
|
||||
Source Location: (28:0,28 [5] /TestFiles/Input/_ViewImports.cshtml)
|
||||
|Model|
|
||||
Generated Location: (2200:83,14 [5] )
|
||||
Generated Location: (2244:84,14 [5] )
|
||||
|Model|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma checksum "TestFiles/Input/Basic.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "54a70ff4c6d27ac6cdc6725cb6bab12012015729"
|
||||
#pragma checksum "/TestFiles/Input/Basic.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "54a70ff4c6d27ac6cdc6725cb6bab12012015729"
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
@ -29,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_Basic_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
public class _TestFiles_Input_Basic_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -38,7 +38,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
WriteLiteral("<div");
|
||||
EndContext();
|
||||
BeginWriteAttribute("class", " class=\"", 4, "\"", 17, 1);
|
||||
#line 1 "TestFiles/Input/Basic.cshtml"
|
||||
#line 1 "/TestFiles/Input/Basic.cshtml"
|
||||
WriteAttributeValue("", 12, logo, 12, 5, false);
|
||||
|
||||
#line default
|
||||
|
|
@ -48,7 +48,7 @@ WriteAttributeValue("", 12, logo, 12, 5, false);
|
|||
WriteLiteral(">\r\n Hello world\r\n ");
|
||||
EndContext();
|
||||
BeginContext(43, 21, false);
|
||||
#line 3 "TestFiles/Input/Basic.cshtml"
|
||||
#line 3 "/TestFiles/Input/Basic.cshtml"
|
||||
Write(Html.Input("SomeKey"));
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma checksum "TestFiles/Input/Inject.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "225760ec3beca02a80469066fab66433e90ddc2e"
|
||||
#pragma checksum "/TestFiles/Input/Inject.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "225760ec3beca02a80469066fab66433e90ddc2e"
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
@ -29,12 +29,12 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 1 "TestFiles/Input/Inject.cshtml"
|
||||
#line 1 "/TestFiles/Input/Inject.cshtml"
|
||||
using MyNamespace;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_Inject_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
public class _TestFiles_Input_Inject_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma checksum "TestFiles/Input/InjectWithModel.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1f010500f93116162444110956e512df61642f4e"
|
||||
#pragma checksum "/TestFiles/Input/InjectWithModel.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1f010500f93116162444110956e512df61642f4e"
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
@ -29,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_InjectWithModel_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel>
|
||||
public class _TestFiles_Input_InjectWithModel_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel>
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma checksum "TestFiles/Input/InjectWithSemicolon.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "fc807ec0dc76610bdca62f482fefd7f584348df9"
|
||||
#pragma checksum "/TestFiles/Input/InjectWithSemicolon.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "fc807ec0dc76610bdca62f482fefd7f584348df9"
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
@ -29,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_InjectWithSemicolon_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel>
|
||||
public class _TestFiles_Input_InjectWithSemicolon_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<MyModel>
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma checksum "TestFiles/Input/Model.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "31c5b047a450ac9f6dc4116626667d26bfb657ba"
|
||||
#pragma checksum "/TestFiles/Input/Model.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "31c5b047a450ac9f6dc4116626667d26bfb657ba"
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
@ -29,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_Model_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<System.Collections.IEnumerable>
|
||||
public class _TestFiles_Input_Model_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<System.Collections.IEnumerable>
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma checksum "TestFiles/Input/ModelExpressionTagHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "55aa7d9113d1666f0c8e05c6ad9b86fc8464b277"
|
||||
#pragma checksum "/TestFiles/Input/ModelExpressionTagHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "55aa7d9113d1666f0c8e05c6ad9b86fc8464b277"
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
@ -29,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input_ModelExpressionTagHelper_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime>
|
||||
public class _TestFiles_Input_ModelExpressionTagHelper_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<DateTime>
|
||||
{
|
||||
#line hidden
|
||||
#pragma warning disable 0414
|
||||
|
|
@ -64,7 +64,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
);
|
||||
__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper);
|
||||
#line 5 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
#line 5 "/TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Now);
|
||||
|
||||
#line default
|
||||
|
|
@ -87,7 +87,7 @@ __Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper.For = ModelExpres
|
|||
);
|
||||
__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper);
|
||||
#line 6 "TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
#line 6 "/TestFiles/Input/ModelExpressionTagHelper.cshtml"
|
||||
__Microsoft_AspNetCore_Mvc_Razor_Extensions_InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => Model);
|
||||
|
||||
#line default
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma checksum "TestFiles/Input/_ViewImports.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "778b41f9406fcda776cc3f1bf093f3b21956e582"
|
||||
#pragma checksum "/TestFiles/Input/_ViewImports.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "778b41f9406fcda776cc3f1bf093f3b21956e582"
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
@ -29,7 +29,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|||
|
||||
#line default
|
||||
#line hidden
|
||||
public class TestFiles_Input__ViewImports_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
public class _TestFiles_Input__ViewImports_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
|
|||
Loading…
Reference in New Issue