Generate assembly attributes as part of code generation
This commit is contained in:
parent
f658d3a080
commit
d5c1c63d19
|
|
@ -0,0 +1,76 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Diagnostics;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.Language.Intermediate;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
||||
{
|
||||
public class AssemblyAttributeInjectionPass : RazorIRPassBase, IRazorIROptimizationPass
|
||||
{
|
||||
private const string RazorViewAttribute = "global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute";
|
||||
private const string RazorPageAttribute = "global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute";
|
||||
|
||||
protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIRNode irDocument)
|
||||
{
|
||||
var @namespace = irDocument.FindPrimaryNamespace();
|
||||
if (@namespace == null || string.IsNullOrEmpty(@namespace.Content))
|
||||
{
|
||||
// No namespace node or it's incomplete. Skip.
|
||||
return;
|
||||
}
|
||||
|
||||
var @class = irDocument.FindPrimaryClass();
|
||||
if (@class == null || string.IsNullOrEmpty(@class.Name))
|
||||
{
|
||||
// No class node or it's incomplete. Skip.
|
||||
return;
|
||||
}
|
||||
|
||||
var generatedTypeName = $"{@namespace.Content}.{@class.Name}";
|
||||
var path = codeDocument.GetRelativePath();
|
||||
var escapedPath = EscapeAsVerbatimLiteral(path);
|
||||
|
||||
string attribute;
|
||||
if (irDocument.DocumentKind == MvcViewDocumentClassifierPass.MvcViewDocumentKind)
|
||||
{
|
||||
attribute = $"[assembly:{RazorViewAttribute}({escapedPath}, typeof({generatedTypeName}))]";
|
||||
}
|
||||
else if (irDocument.DocumentKind == RazorPageDocumentClassifierPass.RazorPageDocumentKind &&
|
||||
PageDirective.TryGetPageDirective(irDocument, out var pageDirective))
|
||||
{
|
||||
var escapedRoutePrefix = EscapeAsVerbatimLiteral(pageDirective.RouteTemplate);
|
||||
attribute = $"[assembly:{RazorPageAttribute}({escapedPath}, typeof({generatedTypeName}), {escapedRoutePrefix})]";
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var index = irDocument.Children.IndexOf(@namespace);
|
||||
Debug.Assert(index >= 0);
|
||||
|
||||
var pageAttribute = new CSharpStatementIRNode();
|
||||
RazorIRBuilder.Create(pageAttribute)
|
||||
.Add(new RazorIRToken()
|
||||
{
|
||||
Kind = RazorIRToken.TokenKind.CSharp,
|
||||
Content = attribute,
|
||||
});
|
||||
|
||||
irDocument.Children.Insert(index, pageAttribute);
|
||||
}
|
||||
|
||||
private static string EscapeAsVerbatimLiteral(string value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
|
||||
value = value.Replace("\"", "\"\"");
|
||||
return $"@\"{value}\"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,16 +16,13 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
DirectiveKind.SingleLine,
|
||||
builder => builder.AddOptionalStringToken());
|
||||
|
||||
private PageDirective(string routeTemplate, string pageName)
|
||||
private PageDirective(string routeTemplate)
|
||||
{
|
||||
RouteTemplate = routeTemplate;
|
||||
PageName = pageName;
|
||||
}
|
||||
|
||||
public string RouteTemplate { get; }
|
||||
|
||||
public string PageName { get; }
|
||||
|
||||
public static IRazorEngineBuilder Register(IRazorEngineBuilder builder)
|
||||
{
|
||||
builder.AddDirective(Directive);
|
||||
|
|
@ -48,18 +45,12 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
|
||||
var tokens = visitor.DirectiveNode.Tokens.ToList();
|
||||
string routeTemplate = null;
|
||||
string pageName = null;
|
||||
if (tokens.Count > 0)
|
||||
{
|
||||
routeTemplate = TrimQuotes(tokens[0].Content);
|
||||
}
|
||||
|
||||
if (tokens.Count > 1)
|
||||
{
|
||||
pageName = TrimQuotes(tokens[1].Content);
|
||||
}
|
||||
|
||||
pageDirective = new PageDirective(routeTemplate, pageName);
|
||||
pageDirective = new PageDirective(routeTemplate);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
builder.Features.Add(new ViewComponentTagHelperPass());
|
||||
builder.Features.Add(new RazorPageDocumentClassifierPass());
|
||||
builder.Features.Add(new MvcViewDocumentClassifierPass());
|
||||
builder.Features.Add(new AssemblyAttributeInjectionPass());
|
||||
|
||||
if (!builder.DesignTime)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,382 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.Language.Intermediate;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
||||
{
|
||||
public class AssemblyAttributeInjectionPassTest
|
||||
{
|
||||
[Fact]
|
||||
public void Execute_NoOps_IfNamespaceNodeIsMissing()
|
||||
{
|
||||
// Arrange
|
||||
var irDocument = new DocumentIRNode();
|
||||
var pass = new AssemblyAttributeInjectionPass
|
||||
{
|
||||
Engine = RazorEngine.Create(),
|
||||
};
|
||||
|
||||
// Act
|
||||
pass.Execute(TestRazorCodeDocument.CreateEmpty(), irDocument);
|
||||
|
||||
// Assert
|
||||
Assert.Empty(irDocument.Children);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_NoOps_IfNamespaceNodeHasEmptyContent()
|
||||
{
|
||||
// Arrange
|
||||
var irDocument = new DocumentIRNode();
|
||||
var builder = RazorIRBuilder.Create(irDocument);
|
||||
var @namespace = new NamespaceDeclarationIRNode() { Content = string.Empty };
|
||||
@namespace.Annotations[CommonAnnotations.PrimaryNamespace] = CommonAnnotations.PrimaryNamespace;
|
||||
builder.Push(@namespace);
|
||||
|
||||
var pass = new AssemblyAttributeInjectionPass
|
||||
{
|
||||
Engine = RazorEngine.Create(),
|
||||
};
|
||||
|
||||
// Act
|
||||
pass.Execute(TestRazorCodeDocument.CreateEmpty(), irDocument);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(irDocument.Children,
|
||||
node => Assert.Same(@namespace, node));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_NoOps_IfClassNameNodeIsMissing()
|
||||
{
|
||||
// Arrange
|
||||
var irDocument = new DocumentIRNode();
|
||||
var builder = RazorIRBuilder.Create(irDocument);
|
||||
var @namespace = new NamespaceDeclarationIRNode() { Content = "SomeNamespace" };
|
||||
builder.Push(@namespace);
|
||||
|
||||
var pass = new AssemblyAttributeInjectionPass
|
||||
{
|
||||
Engine = RazorEngine.Create(),
|
||||
};
|
||||
|
||||
// Act
|
||||
pass.Execute(TestRazorCodeDocument.CreateEmpty(), irDocument);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(irDocument.Children,
|
||||
node => Assert.Same(@namespace, node));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_NoOps_IfClassNameIsEmpty()
|
||||
{
|
||||
// Arrange
|
||||
var irDocument = new DocumentIRNode();
|
||||
var builder = RazorIRBuilder.Create(irDocument);
|
||||
var @namespace = new NamespaceDeclarationIRNode
|
||||
{
|
||||
Content = "SomeNamespace",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryNamespace] = CommonAnnotations.PrimaryNamespace,
|
||||
},
|
||||
};
|
||||
builder.Push(@namespace);
|
||||
var @class = new ClassDeclarationIRNode
|
||||
{
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass,
|
||||
},
|
||||
};
|
||||
builder.Add(@class);
|
||||
|
||||
var pass = new AssemblyAttributeInjectionPass
|
||||
{
|
||||
Engine = RazorEngine.Create(),
|
||||
};
|
||||
|
||||
// Act
|
||||
pass.Execute(TestRazorCodeDocument.CreateEmpty(), irDocument);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(irDocument.Children,
|
||||
node => Assert.Same(@namespace, node));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_NoOps_IfDocumentIsNotViewOrPage()
|
||||
{
|
||||
// Arrange
|
||||
var irDocument = new DocumentIRNode
|
||||
{
|
||||
DocumentKind = "Default",
|
||||
};
|
||||
var builder = RazorIRBuilder.Create(irDocument);
|
||||
var @namespace = new NamespaceDeclarationIRNode() { Content = "SomeNamespace" };
|
||||
builder.Push(@namespace);
|
||||
var @class = new ClassDeclarationIRNode
|
||||
{
|
||||
Name = "SomeName",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass,
|
||||
},
|
||||
};
|
||||
builder.Add(@class);
|
||||
|
||||
var pass = new AssemblyAttributeInjectionPass
|
||||
{
|
||||
Engine = RazorEngine.Create(),
|
||||
};
|
||||
|
||||
// Act
|
||||
pass.Execute(TestRazorCodeDocument.CreateEmpty(), irDocument);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(irDocument.Children,
|
||||
node => Assert.Same(@namespace, node));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_AddsRazorViewAttribute_ToViews()
|
||||
{
|
||||
// Arrange
|
||||
var expectedAttribute = "[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@\"/Views/Index.cshtml\", typeof(SomeNamespace.SomeName))]";
|
||||
var irDocument = new DocumentIRNode
|
||||
{
|
||||
DocumentKind = MvcViewDocumentClassifierPass.MvcViewDocumentKind,
|
||||
};
|
||||
var builder = RazorIRBuilder.Create(irDocument);
|
||||
var @namespace = new NamespaceDeclarationIRNode
|
||||
{
|
||||
Content = "SomeNamespace",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryNamespace] = CommonAnnotations.PrimaryNamespace
|
||||
},
|
||||
};
|
||||
builder.Push(@namespace);
|
||||
var @class = new ClassDeclarationIRNode
|
||||
{
|
||||
Name = "SomeName",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass,
|
||||
},
|
||||
};
|
||||
builder.Add(@class);
|
||||
|
||||
var pass = new AssemblyAttributeInjectionPass
|
||||
{
|
||||
Engine = RazorEngine.Create(),
|
||||
};
|
||||
var document = TestRazorCodeDocument.CreateEmpty();
|
||||
document.SetRelativePath("/Views/Index.cshtml");
|
||||
|
||||
// Act
|
||||
pass.Execute(document, irDocument);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(irDocument.Children,
|
||||
node =>
|
||||
{
|
||||
var csharpStatement = Assert.IsType<CSharpStatementIRNode>(node);
|
||||
var token = Assert.IsType<RazorIRToken>(Assert.Single(csharpStatement.Children));
|
||||
Assert.Equal(RazorIRToken.TokenKind.CSharp, token.Kind);
|
||||
Assert.Equal(expectedAttribute, token.Content);
|
||||
},
|
||||
node => Assert.Same(@namespace, node));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_EscapesViewPathWhenAddingAttributeToViews()
|
||||
{
|
||||
// Arrange
|
||||
var expectedAttribute = "[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@\"\\test\\\"\"Index.cshtml\", typeof(SomeNamespace.SomeName))]";
|
||||
var irDocument = new DocumentIRNode
|
||||
{
|
||||
DocumentKind = MvcViewDocumentClassifierPass.MvcViewDocumentKind,
|
||||
};
|
||||
var builder = RazorIRBuilder.Create(irDocument);
|
||||
var @namespace = new NamespaceDeclarationIRNode
|
||||
{
|
||||
Content = "SomeNamespace",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryNamespace] = CommonAnnotations.PrimaryNamespace
|
||||
},
|
||||
};
|
||||
builder.Push(@namespace);
|
||||
var @class = new ClassDeclarationIRNode
|
||||
{
|
||||
Name = "SomeName",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass,
|
||||
},
|
||||
};
|
||||
builder.Add(@class);
|
||||
|
||||
var pass = new AssemblyAttributeInjectionPass
|
||||
{
|
||||
Engine = RazorEngine.Create(),
|
||||
};
|
||||
var document = TestRazorCodeDocument.CreateEmpty();
|
||||
document.SetRelativePath("\\test\\\"Index.cshtml");
|
||||
|
||||
// Act
|
||||
pass.Execute(document, irDocument);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(irDocument.Children,
|
||||
node =>
|
||||
{
|
||||
var csharpStatement = Assert.IsType<CSharpStatementIRNode>(node);
|
||||
var token = Assert.IsType<RazorIRToken>(Assert.Single(csharpStatement.Children));
|
||||
Assert.Equal(RazorIRToken.TokenKind.CSharp, token.Kind);
|
||||
Assert.Equal(expectedAttribute, token.Content);
|
||||
},
|
||||
node => Assert.Same(@namespace, node));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_AddsRazorPagettribute_ToPage()
|
||||
{
|
||||
// Arrange
|
||||
var expectedAttribute = "[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(@\"/Views/Index.cshtml\", typeof(SomeNamespace.SomeName), null)]";
|
||||
var irDocument = new DocumentIRNode
|
||||
{
|
||||
DocumentKind = RazorPageDocumentClassifierPass.RazorPageDocumentKind,
|
||||
};
|
||||
var builder = RazorIRBuilder.Create(irDocument);
|
||||
var pageDirective = new DirectiveIRNode
|
||||
{
|
||||
Descriptor = PageDirective.Directive,
|
||||
};
|
||||
builder.Add(pageDirective);
|
||||
|
||||
var @namespace = new NamespaceDeclarationIRNode
|
||||
{
|
||||
Content = "SomeNamespace",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryNamespace] = CommonAnnotations.PrimaryNamespace
|
||||
},
|
||||
};
|
||||
builder.Push(@namespace);
|
||||
var @class = new ClassDeclarationIRNode
|
||||
{
|
||||
Name = "SomeName",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass,
|
||||
},
|
||||
};
|
||||
builder.Add(@class);
|
||||
|
||||
var pass = new AssemblyAttributeInjectionPass
|
||||
{
|
||||
Engine = RazorEngine.Create(),
|
||||
};
|
||||
var document = TestRazorCodeDocument.CreateEmpty();
|
||||
document.SetRelativePath("/Views/Index.cshtml");
|
||||
|
||||
// Act
|
||||
pass.Execute(document, irDocument);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(irDocument.Children,
|
||||
node => Assert.Same(pageDirective, node),
|
||||
node =>
|
||||
{
|
||||
var csharpStatement = Assert.IsType<CSharpStatementIRNode>(node);
|
||||
var token = Assert.IsType<RazorIRToken>(Assert.Single(csharpStatement.Children));
|
||||
Assert.Equal(RazorIRToken.TokenKind.CSharp, token.Kind);
|
||||
Assert.Equal(expectedAttribute, token.Content);
|
||||
},
|
||||
node => Assert.Same(@namespace, node));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_EscapesViewPathAndRouteWhenAddingAttributeToPage()
|
||||
{
|
||||
// Arrange
|
||||
var expectedAttribute = "[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@\"\\test\\\"\"Index.cshtml\", typeof(SomeNamespace.SomeName))]";
|
||||
var irDocument = new DocumentIRNode
|
||||
{
|
||||
DocumentKind = MvcViewDocumentClassifierPass.MvcViewDocumentKind,
|
||||
};
|
||||
var builder = RazorIRBuilder.Create(irDocument);
|
||||
var @namespace = new NamespaceDeclarationIRNode
|
||||
{
|
||||
Content = "SomeNamespace",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryNamespace] = CommonAnnotations.PrimaryNamespace
|
||||
},
|
||||
};
|
||||
builder.Push(@namespace);
|
||||
var @class = new ClassDeclarationIRNode
|
||||
{
|
||||
Name = "SomeName",
|
||||
Annotations =
|
||||
{
|
||||
[CommonAnnotations.PrimaryClass] = CommonAnnotations.PrimaryClass,
|
||||
},
|
||||
};
|
||||
|
||||
builder.Add(@class);
|
||||
|
||||
var pass = new AssemblyAttributeInjectionPass
|
||||
{
|
||||
Engine = RazorEngine.Create(),
|
||||
};
|
||||
var document = TestRazorCodeDocument.CreateEmpty();
|
||||
document.SetRelativePath("\\test\\\"Index.cshtml");
|
||||
|
||||
// Act
|
||||
pass.Execute(document, irDocument);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(irDocument.Children,
|
||||
node =>
|
||||
{
|
||||
var csharpStatement = Assert.IsType<CSharpStatementIRNode>(node);
|
||||
var token = Assert.IsType<RazorIRToken>(Assert.Single(csharpStatement.Children));
|
||||
Assert.Equal(RazorIRToken.TokenKind.CSharp, token.Kind);
|
||||
Assert.Equal(expectedAttribute, token.Content);
|
||||
},
|
||||
node => Assert.Same(@namespace, node));
|
||||
}
|
||||
|
||||
private RazorEngine CreateEngine()
|
||||
{
|
||||
return RazorEngine.Create(b =>
|
||||
{
|
||||
// Notice we're not registering the InjectDirective.Pass here so we can run it on demand.
|
||||
b.Features.Add(new AssemblyAttributeInjectionPass());
|
||||
});
|
||||
}
|
||||
|
||||
private DocumentIRNode CreateIRDocument(RazorEngine engine, RazorCodeDocument codeDocument)
|
||||
{
|
||||
for (var i = 0; i < engine.Phases.Count; i++)
|
||||
{
|
||||
var phase = engine.Phases[i];
|
||||
phase.Execute(codeDocument);
|
||||
|
||||
if (phase is IRazorDocumentClassifierPhase)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return codeDocument.GetIRDocument();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -15,9 +15,6 @@ using Microsoft.CodeAnalysis.Emit;
|
|||
using Microsoft.CodeAnalysis.Razor;
|
||||
using Microsoft.Extensions.DependencyModel;
|
||||
using Xunit;
|
||||
#if !NET46
|
||||
using System.Runtime.Loader;
|
||||
#endif
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests
|
||||
{
|
||||
|
|
@ -572,19 +569,11 @@ public class AllTagHelper : {typeof(TagHelper).FullName}
|
|||
|
||||
if (expectedErrors == null)
|
||||
{
|
||||
Assert.Equal(0, errors.Count());
|
||||
Assert.Empty(errors.Select(e => e.GetMessage()));
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Equal(expectedErrors.Count(), errors.Count());
|
||||
|
||||
var expectedArray = expectedErrors.ToArray();
|
||||
var actualArray = errors.ToArray();
|
||||
|
||||
for (var i = 0; i < expectedErrors.Count(); i++)
|
||||
{
|
||||
Assert.Equal(expectedArray[i], actualArray[i].GetMessage());
|
||||
}
|
||||
Assert.Equal(expectedErrors, errors.Select(e => e.GetMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -687,12 +676,7 @@ public class AllTagHelper : {typeof(TagHelper).FullName}
|
|||
private static IEnumerable<MetadataReference> CreateMvcShimReferences(string mvcShimName)
|
||||
{
|
||||
var dllPath = Path.Combine(Directory.GetCurrentDirectory(), mvcShimName);
|
||||
Assembly assembly;
|
||||
#if NET46
|
||||
assembly = Assembly.LoadFile(dllPath);
|
||||
#else
|
||||
assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(dllPath);
|
||||
#endif
|
||||
var assembly = Assembly.LoadFile(dllPath);
|
||||
var assemblyDependencyContext = DependencyContext.Load(assembly);
|
||||
|
||||
var assemblyReferencePaths = assemblyDependencyContext.CompileLibraries.SelectMany(l => l.ResolveReferencePaths());
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
// Assert
|
||||
Assert.True(result);
|
||||
Assert.Null(pageDirective.RouteTemplate);
|
||||
Assert.Null(pageDirective.PageName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -80,7 +79,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
// Assert
|
||||
Assert.True(result);
|
||||
Assert.Null(pageDirective.RouteTemplate);
|
||||
Assert.Null(pageDirective.PageName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -99,7 +97,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
// Assert
|
||||
Assert.True(result);
|
||||
Assert.Equal("some-route-template", pageDirective.RouteTemplate);
|
||||
Assert.Null(pageDirective.PageName);
|
||||
}
|
||||
|
||||
private RazorEngine CreateEngine()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
Source Location: (13:0,13 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
|this.ToString()|
|
||||
Generated Location: (909:22,13 [15] )
|
||||
Generated Location: (1087:23,13 [15] )
|
||||
|this.ToString()|
|
||||
|
||||
Source Location: (54:2,5 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
|string.Format("{0}", "Hello")|
|
||||
Generated Location: (1045:27,6 [29] )
|
||||
Generated Location: (1223:28,6 [29] )
|
||||
|string.Format("{0}", "Hello")|
|
||||
|
||||
Source Location: (95:4,2 [25] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
|
|
||||
var cls = "foo";
|
||||
|
|
||||
Generated Location: (1191:32,2 [25] )
|
||||
Generated Location: (1369:33,2 [25] )
|
||||
|
|
||||
var cls = "foo";
|
||||
|
|
||||
|
||||
Source Location: (134:7,11 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
|if(cls != null) { |
|
||||
Generated Location: (1339:38,11 [18] )
|
||||
Generated Location: (1517:39,11 [18] )
|
||||
|if(cls != null) { |
|
||||
|
||||
Source Location: (153:7,30 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
|cls|
|
||||
Generated Location: (1501:43,30 [3] )
|
||||
Generated Location: (1679:44,30 [3] )
|
||||
|cls|
|
||||
|
||||
Source Location: (156:7,33 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
| }|
|
||||
Generated Location: (1652:48,33 [2] )
|
||||
Generated Location: (1830:49,33 [2] )
|
||||
| }|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "4120ddad9d4353ed260e0585fe71080d78ff8ab3"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Source Location: (10:0,10 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml)
|
||||
|MyBasePageForViews<TModel>|
|
||||
Generated Location: (602:16,0 [26] )
|
||||
Generated Location: (792:17,0 [26] )
|
||||
|MyBasePageForViews<TModel>|
|
||||
|
||||
Source Location: (45:1,7 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml)
|
||||
|MyModel|
|
||||
Generated Location: (742:20,0 [7] )
|
||||
Generated Location: (932:21,0 [7] )
|
||||
|MyModel|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "91cf923452a86b2906083cb0236d6d5b3bc528ef"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports_cshtml), null)]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports_cshtml), null)]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
Source Location: (14:1,7 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports.cshtml)
|
||||
|MyModel|
|
||||
Generated Location: (601:16,0 [7] )
|
||||
Generated Location: (811:17,0 [7] )
|
||||
|MyModel|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "052fe5ad02d36ebdf943dddd543cb26aaff62411"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports_cshtml), null)]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports_cshtml), null)]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
Source Location: (7:0,7 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml)
|
||||
|MyModel|
|
||||
Generated Location: (630:16,0 [7] )
|
||||
Generated Location: (818:17,0 [7] )
|
||||
|MyModel|
|
||||
|
||||
Source Location: (24:1,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml)
|
||||
|MyApp|
|
||||
Generated Location: (732:20,0 [5] )
|
||||
Generated Location: (920:21,0 [5] )
|
||||
|MyApp|
|
||||
|
||||
Source Location: (30:1,14 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml)
|
||||
|MyPropertyName|
|
||||
Generated Location: (852:24,22 [14] )
|
||||
Generated Location: (1040:25,22 [14] )
|
||||
|MyPropertyName|
|
||||
|
||||
Source Location: (54:2,8 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml)
|
||||
|MyService<TModel>|
|
||||
Generated Location: (936:28,0 [17] )
|
||||
Generated Location: (1124:29,0 [17] )
|
||||
|MyService<TModel>|
|
||||
|
||||
Source Location: (72:2,26 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml)
|
||||
|Html|
|
||||
Generated Location: (1080:32,22 [4] )
|
||||
Generated Location: (1268:33,22 [4] )
|
||||
|Html|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a039b7091118c718dc3023b6ac58d9645cb58e59"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,45 +1,45 @@
|
|||
Source Location: (7:0,7 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml)
|
||||
|MyModel|
|
||||
Generated Location: (634:16,0 [7] )
|
||||
Generated Location: (826:17,0 [7] )
|
||||
|MyModel|
|
||||
|
||||
Source Location: (24:1,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml)
|
||||
|MyApp|
|
||||
Generated Location: (736:20,0 [5] )
|
||||
Generated Location: (928:21,0 [5] )
|
||||
|MyApp|
|
||||
|
||||
Source Location: (30:1,14 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml)
|
||||
|MyPropertyName|
|
||||
Generated Location: (856:24,22 [14] )
|
||||
Generated Location: (1048:25,22 [14] )
|
||||
|MyPropertyName|
|
||||
|
||||
Source Location: (58:2,8 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml)
|
||||
|MyService<TModel>|
|
||||
Generated Location: (940:28,0 [17] )
|
||||
Generated Location: (1132:29,0 [17] )
|
||||
|MyService<TModel>|
|
||||
|
||||
Source Location: (76:2,26 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml)
|
||||
|Html|
|
||||
Generated Location: (1084:32,22 [4] )
|
||||
Generated Location: (1276:33,22 [4] )
|
||||
|Html|
|
||||
|
||||
Source Location: (93:3,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml)
|
||||
|MyApp|
|
||||
Generated Location: (1158:36,0 [5] )
|
||||
Generated Location: (1350:37,0 [5] )
|
||||
|MyApp|
|
||||
|
||||
Source Location: (99:3,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml)
|
||||
|MyPropertyName2|
|
||||
Generated Location: (1278:40,22 [15] )
|
||||
Generated Location: (1470:41,22 [15] )
|
||||
|MyPropertyName2|
|
||||
|
||||
Source Location: (129:4,8 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml)
|
||||
|MyService<TModel>|
|
||||
Generated Location: (1363:44,0 [17] )
|
||||
Generated Location: (1555:45,0 [17] )
|
||||
|MyService<TModel>|
|
||||
|
||||
Source Location: (147:4,26 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml)
|
||||
|Html2|
|
||||
Generated Location: (1507:48,22 [5] )
|
||||
Generated Location: (1699:49,22 [5] )
|
||||
|Html2|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "5010aab35d235175dab517f8018e41aee9a2ac7f"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Source Location: (8:0,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml)
|
||||
|MyApp|
|
||||
Generated Location: (621:16,0 [5] )
|
||||
Generated Location: (800:17,0 [5] )
|
||||
|MyApp|
|
||||
|
||||
Source Location: (14:0,14 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml)
|
||||
|MyPropertyName|
|
||||
Generated Location: (741:20,22 [14] )
|
||||
Generated Location: (920:21,22 [14] )
|
||||
|MyPropertyName|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "c711078454f5b0e8d2cb77d9cb7fa88cca32b884"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective_cshtml), null)]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective_cshtml), null)]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "5a9ff8440150c6746e4a8ba63bc633ea84930405"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective_cshtml), null)]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective_cshtml), null)]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
Source Location: (7:0,7 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml)
|
||||
|DateTime|
|
||||
Generated Location: (640:16,0 [8] )
|
||||
Generated Location: (837:17,0 [8] )
|
||||
|DateTime|
|
||||
|
||||
Source Location: (33:2,14 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml)
|
||||
|"InputTestTagHelper, AppCode"|
|
||||
Generated Location: (781:20,37 [29] )
|
||||
Generated Location: (978:21,37 [29] )
|
||||
|"InputTestTagHelper, AppCode"|
|
||||
|
||||
Source Location: (83:4,17 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml)
|
||||
|Date|
|
||||
Generated Location: (1426:32,102 [4] )
|
||||
Generated Location: (1623:33,102 [4] )
|
||||
|Date|
|
||||
|
||||
Source Location: (111:5,18 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml)
|
||||
|Model|
|
||||
Generated Location: (1742:38,94 [5] )
|
||||
Generated Location: (1939:39,94 [5] )
|
||||
|Model|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0906a816db301fe624bbe5a96c4b3013071ea492"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
Source Location: (7:0,7 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model.cshtml)
|
||||
|System.Collections.IEnumerable|
|
||||
Generated Location: (643:16,0 [30] )
|
||||
Generated Location: (821:17,0 [30] )
|
||||
|System.Collections.IEnumerable|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "31c5b047a450ac9f6dc4116626667d26bfb657ba"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MultipleModels_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MultipleModels_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Source Location: (7:0,7 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels.cshtml)
|
||||
|ThisShouldBeGenerated|
|
||||
Generated Location: (652:16,0 [21] )
|
||||
Generated Location: (839:17,0 [21] )
|
||||
|ThisShouldBeGenerated|
|
||||
|
||||
Source Location: (37:1,7 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels.cshtml)
|
||||
|System.Collections.IEnumerable|
|
||||
Generated Location: (782:20,0 [30] )
|
||||
Generated Location: (969:21,0 [30] )
|
||||
|System.Collections.IEnumerable|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(Test.Namespace.PageWithNamespace_Page), null)]
|
||||
namespace Test.Namespace
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(Test.Namespace.PageWithNamespace_Page), null)]
|
||||
NamespaceDeclaration - - Test.Namespace
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
Source Location: (18:1,11 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace.cshtml)
|
||||
|Test.Namespace|
|
||||
Generated Location: (612:16,44 [14] )
|
||||
Generated Location: (761:17,44 [14] )
|
||||
|Test.Namespace|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "b205857d3dad47cb3f0c1d7775ae251b306ab830"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(Test.Namespace.PageWithNamespace_Page), null)]
|
||||
namespace Test.Namespace
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(Test.Namespace.PageWithNamespace_Page), null)]
|
||||
NamespaceDeclaration - - Test.Namespace
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml), null)]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml), null)]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
Source Location: (38:3,1 [41] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml)
|
||||
|using Microsoft.AspNetCore.Mvc.RazorPages|
|
||||
Generated Location: (435:12,0 [41] )
|
||||
Generated Location: (644:13,0 [41] )
|
||||
|using Microsoft.AspNetCore.Mvc.RazorPages|
|
||||
|
||||
Source Location: (23:2,14 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml)
|
||||
|"*, AppCode"|
|
||||
Generated Location: (838:21,37 [12] )
|
||||
Generated Location: (1047:22,37 [12] )
|
||||
|"*, AppCode"|
|
||||
|
||||
Source Location: (566:24,47 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml)
|
||||
|Name|
|
||||
Generated Location: (1386:33,47 [4] )
|
||||
Generated Location: (1595:34,47 [4] )
|
||||
|Name|
|
||||
|
||||
Source Location: (95:5,12 [283] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml)
|
||||
|
|
@ -28,7 +28,7 @@ Source Location: (95:5,12 [283] TestFiles/IntegrationTests/CodeGenerationIntegra
|
|||
public string Name { get; set; }
|
||||
}
|
||||
|
|
||||
Generated Location: (1867:44,12 [283] )
|
||||
Generated Location: (2076:45,12 [283] )
|
||||
|
|
||||
public IActionResult OnPost(Customer customer)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "c0587249e6e0b7ba4e1efc463f58577d5d0b6ae2"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml), null)]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel_cshtml), null)]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages_cshtml), null)]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages_cshtml), null)]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
Source Location: (55:4,1 [41] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml)
|
||||
|using Microsoft.AspNetCore.Mvc.RazorPages|
|
||||
Generated Location: (423:12,0 [41] )
|
||||
Generated Location: (620:13,0 [41] )
|
||||
|using Microsoft.AspNetCore.Mvc.RazorPages|
|
||||
|
||||
Source Location: (16:2,7 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml)
|
||||
|NewModel|
|
||||
Generated Location: (777:21,0 [8] )
|
||||
Generated Location: (974:22,0 [8] )
|
||||
|NewModel|
|
||||
|
||||
Source Location: (40:3,14 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml)
|
||||
|"*, AppCode"|
|
||||
Generated Location: (918:25,37 [12] )
|
||||
Generated Location: (1115:26,37 [12] )
|
||||
|"*, AppCode"|
|
||||
|
||||
Source Location: (661:28,47 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml)
|
||||
|Model.Name|
|
||||
Generated Location: (1454:37,47 [10] )
|
||||
Generated Location: (1651:38,47 [10] )
|
||||
|Model.Name|
|
||||
|
||||
Source Location: (112:6,12 [360] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml)
|
||||
|
|
@ -36,7 +36,7 @@ Source Location: (112:6,12 [360] TestFiles/IntegrationTests/CodeGenerationIntegr
|
|||
public string Name { get; set; }
|
||||
}
|
||||
|
|
||||
Generated Location: (1929:48,12 [360] )
|
||||
Generated Location: (2126:49,12 [360] )
|
||||
|
|
||||
public class NewModel : PageModel
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "608b3f7b9b29c66ee25bde2d20324b4bef1aa070"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages_cshtml), null)]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages_cshtml), null)]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
Source Location: (14:0,14 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml)
|
||||
|"*, AppCode"|
|
||||
Generated Location: (674:16,37 [12] )
|
||||
Generated Location: (869:17,37 [12] )
|
||||
|"*, AppCode"|
|
||||
|
||||
Source Location: (30:1,2 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml)
|
||||
|
|
||||
var foo = "Hello";
|
||||
|
|
||||
Generated Location: (1416:28,2 [26] )
|
||||
Generated Location: (1611:29,2 [26] )
|
||||
|
|
||||
var foo = "Hello";
|
||||
|
|
||||
|
||||
Source Location: (83:5,22 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml)
|
||||
|foo|
|
||||
Generated Location: (1985:36,22 [3] )
|
||||
Generated Location: (2180:37,22 [3] )
|
||||
|foo|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6a0ad3c59f3a87877c36928472f0508bd40cdd8c"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(Test.Namespace.ViewWithNamespace_View))]
|
||||
namespace Test.Namespace
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(Test.Namespace.ViewWithNamespace_View))]
|
||||
NamespaceDeclaration - - Test.Namespace
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
Source Location: (11:0,11 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace.cshtml)
|
||||
|Test.Namespace|
|
||||
Generated Location: (621:16,44 [14] )
|
||||
Generated Location: (756:17,44 [14] )
|
||||
|Test.Namespace|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "2893acf42354a0bc8b6a2698f5d2e4fab0e59dbe"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(Test.Namespace.ViewWithNamespace_View))]
|
||||
namespace Test.Namespace
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(Test.Namespace.ViewWithNamespace_View))]
|
||||
NamespaceDeclaration - - Test.Namespace
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Source Location: (8:0,8 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml)
|
||||
|IHtmlHelper<TModel>|
|
||||
Generated Location: (627:16,0 [19] )
|
||||
Generated Location: (812:17,0 [19] )
|
||||
|IHtmlHelper<TModel>|
|
||||
|
||||
Source Location: (28:0,28 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml)
|
||||
|Model|
|
||||
Generated Location: (775:20,22 [5] )
|
||||
Generated Location: (960:21,22 [5] )
|
||||
|Model|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "778b41f9406fcda776cc3f1bf093f3b21956e582"
|
||||
[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports_cshtml))]
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Document -
|
||||
Checksum -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports_cshtml))]
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.Compilation
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
|
||||
public class RazorViewAttribute : Attribute
|
||||
{
|
||||
public RazorViewAttribute(string path, Type viewType)
|
||||
{
|
||||
Path = path;
|
||||
ViewType = viewType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path of the view.
|
||||
/// </summary>
|
||||
public string Path { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the view type.
|
||||
/// </summary>
|
||||
public Type ViewType { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.Compilation;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
|
||||
{
|
||||
public class RazorPageAttribute : RazorViewAttribute
|
||||
{
|
||||
public RazorPageAttribute(string path, Type viewType, string routeTemplate)
|
||||
: base(path, viewType)
|
||||
{
|
||||
RouteTemplate = routeTemplate;
|
||||
}
|
||||
|
||||
public string RouteTemplate { get; }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue