From c47825944da54e8da781861d1f72b880befdbd87 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 22 Mar 2017 10:00:33 -0700 Subject: [PATCH] Remove Microsoft.AspNetCore.Mvc.Razor.Host --- Mvc.sln | 28 +- .../DefaultAssemblyPartDiscoveryProvider.cs | 2 +- .../IInjectDirectiveTargetExtension.cs | 12 - .../InjectDirective.cs | 90 - .../InjectDirectiveIRNode.cs | 45 - .../InjectDirectiveTargetExtension.cs | 44 - .../Internal/ClassName.cs | 63 - .../Internal/DesignTimeRazorPathNormalizer.cs | 39 - .../Internal/RazorCodeDocumentExtensions.cs | 34 - .../Internal/RazorPathNormalizer.cs | 20 - ...Microsoft.AspNetCore.Mvc.Razor.Host.csproj | 25 - .../ModelDirective.cs | 117 -- .../ModelExpressionPass.cs | 109 -- .../MvcRazorTemplateEngine.cs | 64 - .../MvcViewDocumentClassifierPass.cs | 37 - .../PageDirective.cs | 52 - .../PagesPropertyInjectionPass.cs | 55 - .../Properties/AssemblyInfo.cs | 6 - .../Properties/Resources.Designer.cs | 126 -- .../RazorPageDocumentClassifierPass.cs | 41 - .../Resources.resx | 138 -- ...ComponentTagHelperDescriptorConventions.cs | 27 - .../ViewComponentTagHelperPass.cs | 276 --- .../baseline.net45.json | 1689 ----------------- .../baseline.netcore.json | 1677 ---------------- .../exceptions.net45.json | 98 - .../exceptions.netcore.json | 98 - .../MvcRazorMvcCoreBuilderExtensions.cs | 4 +- .../DefaultRazorPageFactoryProvider.cs | 1 + .../Internal/RazorCompiler.cs | 1 + .../Microsoft.AspNetCore.Mvc.Razor.csproj | 3 +- .../RazorViewEngineOptions.cs | 5 +- .../Internal/DefaultPageLoader.cs | 2 +- .../DictionaryPrefixTestTagHelper.cs | 20 - .../InjectDirectiveTargetExtensionTest.cs | 75 - .../InjectDirectiveTest.cs | 226 --- .../InputTestTagHelper.cs | 13 - .../LineMappingsSerializer.cs | 54 - ...soft.AspNetCore.Mvc.Razor.Host.Test.csproj | 37 - .../ModelDirectiveTest.cs | 220 --- .../ModelExpressionPassTest.cs | 236 --- .../MvcRazorTemplateEngineTest.cs | 127 -- .../MvcViewDocumentClassifierPassTest.cs | 246 --- .../Properties/AssemblyInfo.cs | 6 - .../RazorEngineTest.cs | 238 --- .../RazorPageDocumentClassifierPassTest.cs | 272 --- .../TestFiles/Input/Basic.cshtml | 4 - .../TestFiles/Input/Inject.cshtml | 2 - .../TestFiles/Input/InjectWithModel.cshtml | 3 - .../Input/InjectWithSemicolon.cshtml | 5 - .../TestFiles/Input/Model.cshtml | 1 - .../Input/ModelExpressionTagHelper.cshtml | 10 - .../TestFiles/Input/MultipleModels.cshtml | 2 - .../TestFiles/Input/_ViewImports.cshtml | 1 - .../TestFiles/Output/DesignTime/Basic.cs | 64 - .../Output/DesignTime/Basic.mappings.txt | 10 - .../TestFiles/Output/DesignTime/Inject.cs | 69 - .../Output/DesignTime/Inject.mappings.txt | 10 - .../Output/DesignTime/InjectWithModel.cs | 76 - .../DesignTime/InjectWithModel.mappings.txt | 25 - .../Output/DesignTime/InjectWithSemicolon.cs | 96 - .../InjectWithSemicolon.mappings.txt | 45 - .../TestFiles/Output/DesignTime/Model.cs | 58 - .../Output/DesignTime/Model.mappings.txt | 5 - .../DesignTime/ModelExpressionTagHelper.cs | 97 - .../ModelExpressionTagHelper.mappings.txt | 40 - .../Output/DesignTime/MultipleModels.cs | 62 - .../DesignTime/MultipleModels.mappings.txt | 10 - .../Output/DesignTime/_ViewImports.cs | 64 - .../DesignTime/_ViewImports.mappings.txt | 10 - .../TestFiles/Output/Runtime/Basic.cs | 73 - .../TestFiles/Output/Runtime/Inject.cs | 57 - .../Output/Runtime/InjectWithModel.cs | 52 - .../Output/Runtime/InjectWithSemicolon.cs | 56 - .../TestFiles/Output/Runtime/Model.cs | 50 - .../Runtime/ModelExpressionTagHelper.cs | 179 -- .../TestFiles/Output/Runtime/_ViewImports.cs | 52 - .../Areas/MyArea/Sub/Views/Admin/Test.cshtml | 1 - .../MyArea/Sub/Views/Admin/ViewStart.cshtml | 1 - .../MyArea/Sub/Views/Admin/_ViewStart.cshtml | 0 .../Views/Home/MyView.cshtml | 1 - .../Views/Home/_ViewStart.cshtml | 0 ...onentTagHelperDescriptorConventionsTest.cs | 61 - .../ViewComponentTagHelperPassTest.cs | 388 ---- .../xunit.runner.json | 3 - .../Internal/RazorCompilerTest.cs | 1 + 86 files changed, 12 insertions(+), 8530 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/IInjectDirectiveTargetExtension.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirective.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirectiveIRNode.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirectiveTargetExtension.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/ClassName.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/DesignTimeRazorPathNormalizer.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/RazorCodeDocumentExtensions.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/RazorPathNormalizer.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/Microsoft.AspNetCore.Mvc.Razor.Host.csproj delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/ModelDirective.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/ModelExpressionPass.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcRazorTemplateEngine.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcViewDocumentClassifierPass.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/PageDirective.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/PagesPropertyInjectionPass.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/Properties/AssemblyInfo.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/Properties/Resources.Designer.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/RazorPageDocumentClassifierPass.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/Resources.resx delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/ViewComponentTagHelperDescriptorConventions.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/ViewComponentTagHelperPass.cs delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/baseline.net45.json delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/baseline.netcore.json delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/exceptions.net45.json delete mode 100644 src/Microsoft.AspNetCore.Mvc.Razor.Host/exceptions.netcore.json delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/DictionaryPrefixTestTagHelper.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InjectDirectiveTargetExtensionTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InjectDirectiveTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InputTestTagHelper.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/LineMappingsSerializer.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Microsoft.AspNetCore.Mvc.Razor.Host.Test.csproj delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ModelDirectiveTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ModelExpressionPassTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/MvcRazorTemplateEngineTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/MvcViewDocumentClassifierPassTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Properties/AssemblyInfo.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/RazorEngineTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/RazorPageDocumentClassifierPassTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Basic.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Inject.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/InjectWithModel.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/InjectWithSemicolon.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Model.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/ModelExpressionTagHelper.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/MultipleModels.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/_ViewImports.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.mappings.txt delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.mappings.txt delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.mappings.txt delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.mappings.txt delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.mappings.txt delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.mappings.txt delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/MultipleModels.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/MultipleModels.mappings.txt delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.mappings.txt delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Inject.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/InjectWithModel.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/InjectWithSemicolon.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Model.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/ModelExpressionTagHelper.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/_ViewImports.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/ViewStartUtilityFiles/Areas/MyArea/Sub/Views/Admin/Test.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/ViewStartUtilityFiles/Areas/MyArea/Sub/Views/Admin/ViewStart.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/ViewStartUtilityFiles/Areas/MyArea/Sub/Views/Admin/_ViewStart.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/ViewStartUtilityFiles/Views/Home/MyView.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/ViewStartUtilityFiles/Views/Home/_ViewStart.cshtml delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ViewComponentTagHelperDescriptorConventionsTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ViewComponentTagHelperPassTest.cs delete mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/xunit.runner.json diff --git a/Mvc.sln b/Mvc.sln index d72073b930..0cc28f5099 100644 --- a/Mvc.sln +++ b/Mvc.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26217.2 +VisualStudioVersion = 15.0.26228.9 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{DAAE4C74-D06F-4874-A166-33305D2643CE}" EndProject @@ -18,10 +18,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Ra EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Core.Test", "test\Microsoft.AspNetCore.Mvc.Core.Test\Microsoft.AspNetCore.Mvc.Core.Test.csproj", "{A8AA326E-8EE8-4F11-B750-23028E0949D7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.Host", "src\Microsoft.AspNetCore.Mvc.Razor.Host\Microsoft.AspNetCore.Mvc.Razor.Host.csproj", "{520B3AA4-363A-497C-8C15-80423C5AFC85}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.Host.Test", "test\Microsoft.AspNetCore.Mvc.Razor.Host.Test\Microsoft.AspNetCore.Mvc.Razor.Host.Test.csproj", "{7C4F5973-0491-4028-B1DC-A9BA73FF9F77}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebSites", "WebSites", "{16703B76-C9F7-4C75-AE6C-53D92E308E3C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.FunctionalTests", "test\Microsoft.AspNetCore.Mvc.FunctionalTests\Microsoft.AspNetCore.Mvc.FunctionalTests.csproj", "{323D0C04-B518-4A8F-8A8E-3546AD153D34}" @@ -188,26 +184,6 @@ Global {A8AA326E-8EE8-4F11-B750-23028E0949D7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {A8AA326E-8EE8-4F11-B750-23028E0949D7}.Release|Mixed Platforms.Build.0 = Release|Any CPU {A8AA326E-8EE8-4F11-B750-23028E0949D7}.Release|x86.ActiveCfg = Release|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Debug|Any CPU.Build.0 = Debug|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Debug|x86.ActiveCfg = Debug|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Release|Any CPU.ActiveCfg = Release|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Release|Any CPU.Build.0 = Release|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {520B3AA4-363A-497C-8C15-80423C5AFC85}.Release|x86.ActiveCfg = Release|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Debug|x86.ActiveCfg = Debug|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Release|Any CPU.Build.0 = Release|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77}.Release|x86.ActiveCfg = Release|Any CPU {323D0C04-B518-4A8F-8A8E-3546AD153D34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {323D0C04-B518-4A8F-8A8E-3546AD153D34}.Debug|Any CPU.Build.0 = Debug|Any CPU {323D0C04-B518-4A8F-8A8E-3546AD153D34}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -792,8 +768,6 @@ Global {C48DA9D7-ACB5-4408-AA79-27ECB60A67EF} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E} {3F6E355E-4869-41D9-943B-D54771221A7F} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {A8AA326E-8EE8-4F11-B750-23028E0949D7} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} - {520B3AA4-363A-497C-8C15-80423C5AFC85} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E} - {7C4F5973-0491-4028-B1DC-A9BA73FF9F77} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {16703B76-C9F7-4C75-AE6C-53D92E308E3C} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {323D0C04-B518-4A8F-8A8E-3546AD153D34} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {34DF1487-12C6-476C-BE0A-F31DF1939AE5} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C} diff --git a/src/Microsoft.AspNetCore.Mvc.Core/Internal/DefaultAssemblyPartDiscoveryProvider.cs b/src/Microsoft.AspNetCore.Mvc.Core/Internal/DefaultAssemblyPartDiscoveryProvider.cs index 3932d590bb..29ddd9542e 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/Internal/DefaultAssemblyPartDiscoveryProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/Internal/DefaultAssemblyPartDiscoveryProvider.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal "microsoft.aspnetcore.mvc.formatters.xml", "microsoft.aspnetcore.mvc.localization", "microsoft.aspnetcore.mvc.razor", - "microsoft.aspnetcore.mvc.razor.host", + "microsoft.aspnetcore.mvc.razor.extensions", "microsoft.aspnetcore.mvc.razorpages", "microsoft.aspnetcore.mvc.taghelpers", "microsoft.aspnetcore.mvc.viewfeatures" diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/IInjectDirectiveTargetExtension.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/IInjectDirectiveTargetExtension.cs deleted file mode 100644 index 3feb1c17f0..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/IInjectDirectiveTargetExtension.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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.Evolution.CodeGeneration; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public interface IInjectDirectiveTargetExtension : IRuntimeTargetExtension - { - void WriteInjectProperty(CSharpRenderingContext context, InjectDirectiveIRNode node); - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirective.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirective.cs deleted file mode 100644 index b624b29503..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirective.cs +++ /dev/null @@ -1,90 +0,0 @@ -// 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 System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public static class InjectDirective - { - public static readonly DirectiveDescriptor Directive = DirectiveDescriptorBuilder.Create("inject").AddType().AddMember().Build(); - - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - return builder; - } - - internal class Pass : RazorIRPassBase, IRazorDirectiveClassifierPass - { - public override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIRNode irDocument) - { - var visitor = new Visitor(); - visitor.Visit(irDocument); - var modelType = ModelDirective.GetModelType(irDocument); - - var properties = new HashSet(StringComparer.Ordinal); - - for (var i = visitor.Directives.Count - 1; i >= 0; i--) - { - var directive = visitor.Directives[i]; - var tokens = directive.Tokens.ToArray(); - if (tokens.Length < 2) - { - continue; - } - - var typeName = tokens[0].Content; - var memberName = tokens[1].Content; - - if (!properties.Add(memberName)) - { - continue; - } - - typeName = typeName.Replace("", "<" + modelType + ">"); - - var injectNode = new InjectDirectiveIRNode() - { - TypeName = typeName, - MemberName = memberName, - Source = directive.Source, - Parent = visitor.Class, - }; - - visitor.Class.Children.Add(injectNode); - } - } - } - - private class Visitor : RazorIRNodeWalker - { - public ClassDeclarationIRNode Class { get; private set; } - - public IList Directives { get; } = new List(); - - public override void VisitClass(ClassDeclarationIRNode node) - { - if (Class == null) - { - Class = node; - } - - base.VisitClass(node); - } - - public override void VisitDirective(DirectiveIRNode node) - { - if (node.Descriptor == Directive) - { - Directives.Add(node); - } - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirectiveIRNode.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirectiveIRNode.cs deleted file mode 100644 index 39e0c3b806..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirectiveIRNode.cs +++ /dev/null @@ -1,45 +0,0 @@ -// 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 System.Collections.Generic; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.CodeGeneration; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class InjectDirectiveIRNode : ExtensionIRNode - { - public string TypeName { get; set; } - - public string MemberName { get; set; } - - public override IList Children { get; } = new RazorIRNode[0]; - - public override RazorIRNode Parent { get; set; } - - public override SourceSpan? Source { get; set; } - - public override void Accept(RazorIRNodeVisitor visitor) - { - if (visitor == null) - { - throw new ArgumentNullException(nameof(visitor)); - } - - AcceptExtensionNode(this, visitor); - } - - public override void WriteNode(RuntimeTarget target, CSharpRenderingContext context) - { - if (target == null) - { - throw new ArgumentNullException(nameof(target)); - } - - var extension = target.GetExtension(); - extension.WriteInjectProperty(context, this); - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirectiveTargetExtension.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirectiveTargetExtension.cs deleted file mode 100644 index 510dd100b7..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/InjectDirectiveTargetExtension.cs +++ /dev/null @@ -1,44 +0,0 @@ -// 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.Razor.Evolution.CodeGeneration; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class InjectDirectiveTargetExtension : IInjectDirectiveTargetExtension - { - private const string RazorInjectAttribute = "[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]"; - - public void WriteInjectProperty(CSharpRenderingContext context, InjectDirectiveIRNode node) - { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - if (node == null) - { - throw new ArgumentNullException(nameof(node)); - } - - var property = $"public {node.TypeName} {node.MemberName} {{ get; private set; }}"; - - if (node.Source.HasValue) - { - using (context.Writer.BuildLinePragma(node.Source.Value)) - { - context.Writer - .WriteLine(RazorInjectAttribute) - .WriteLine(property); - } - } - else - { - context.Writer - .WriteLine(RazorInjectAttribute) - .WriteLine(property); - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/ClassName.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/ClassName.cs deleted file mode 100644 index ac902bc576..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/ClassName.cs +++ /dev/null @@ -1,63 +0,0 @@ -// 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.Globalization; -using Microsoft.Extensions.Primitives; - -namespace Microsoft.AspNetCore.Mvc.Razor.Internal -{ - public static class ClassName - { - public static string GetClassNameFromPath(string path) - { - if (string.IsNullOrEmpty(path)) - { - return path; - } - - return SanitizeClassName(path); - } - - // CSharp Spec §2.4.2 - private static bool IsIdentifierStart(char character) - { - return char.IsLetter(character) || - character == '_' || - CharUnicodeInfo.GetUnicodeCategory(character) == UnicodeCategory.LetterNumber; - } - - public static bool IsIdentifierPart(char character) - { - return char.IsDigit(character) || - IsIdentifierStart(character) || - IsIdentifierPartByUnicodeCategory(character); - } - - private static bool IsIdentifierPartByUnicodeCategory(char character) - { - var category = CharUnicodeInfo.GetUnicodeCategory(character); - - return category == UnicodeCategory.NonSpacingMark || // Mn - category == UnicodeCategory.SpacingCombiningMark || // Mc - category == UnicodeCategory.ConnectorPunctuation || // Pc - category == UnicodeCategory.Format; // Cf - } - - private static string SanitizeClassName(string inputName) - { - if (!IsIdentifierStart(inputName[0]) && IsIdentifierPart(inputName[0])) - { - inputName = "_" + inputName; - } - - var builder = new InplaceStringBuilder(inputName.Length); - for (var i = 0; i < inputName.Length; i++) - { - var ch = inputName[i]; - builder.Append(IsIdentifierPart(ch) ? ch : '_'); - } - - return builder.ToString(); - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/DesignTimeRazorPathNormalizer.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/DesignTimeRazorPathNormalizer.cs deleted file mode 100644 index 62452b3c2e..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/DesignTimeRazorPathNormalizer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// 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 System.IO; - -namespace Microsoft.AspNetCore.Mvc.Razor.Internal -{ - public class DesignTimeRazorPathNormalizer : RazorPathNormalizer - { - private readonly string _applicationRoot; - - public DesignTimeRazorPathNormalizer(string applicationRoot) - { - if (applicationRoot == null) - { - throw new ArgumentNullException(nameof(applicationRoot)); - } - - _applicationRoot = applicationRoot; - } - - public override string NormalizePath(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - // Need to convert path to application relative (rooted paths are passed in during design time). - if (Path.IsPathRooted(path) && path.StartsWith(_applicationRoot, StringComparison.Ordinal)) - { - path = path.Substring(_applicationRoot.Length); - } - - return path; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/RazorCodeDocumentExtensions.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/RazorCodeDocumentExtensions.cs deleted file mode 100644 index 6624be0537..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/RazorCodeDocumentExtensions.cs +++ /dev/null @@ -1,34 +0,0 @@ -// 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.Razor.Evolution; - -namespace Microsoft.AspNetCore.Mvc.Razor.Internal -{ - public static class RazorCodeDocumentExtensions - { - private const string RelativePathKey = "relative-path"; - - public static string GetRelativePath(this RazorCodeDocument document) - { - if (document == null) - { - throw new ArgumentNullException(nameof(document)); - } - - return document.Items[RelativePathKey] as string; - } - - - public static void SetRelativePath(this RazorCodeDocument document, string relativePath) - { - if (document == null) - { - throw new ArgumentNullException(nameof(document)); - } - - document.Items[RelativePathKey] = relativePath; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/RazorPathNormalizer.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/RazorPathNormalizer.cs deleted file mode 100644 index 5c44f6e521..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Internal/RazorPathNormalizer.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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.Internal -{ - public class RazorPathNormalizer - { - public virtual string NormalizePath(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - return path; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Microsoft.AspNetCore.Mvc.Razor.Host.csproj b/src/Microsoft.AspNetCore.Mvc.Razor.Host/Microsoft.AspNetCore.Mvc.Razor.Host.csproj deleted file mode 100644 index 0d79c98904..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Microsoft.AspNetCore.Mvc.Razor.Host.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - ASP.NET Core MVC design time hosting infrastructure for the Razor view engine. - net46;netstandard1.6 - $(NoWarn);CS1591 - true - aspnetcore;aspnetcoremvc;cshtml;razor - false - - - - - - - - - - - - - - diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/ModelDirective.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/ModelDirective.cs deleted file mode 100644 index 0516f026d3..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/ModelDirective.cs +++ /dev/null @@ -1,117 +0,0 @@ -// 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 System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public static class ModelDirective - { - public static readonly DirectiveDescriptor Directive = DirectiveDescriptorBuilder.Create("model").AddType().Build(); - - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - return builder; - } - - public static string GetModelType(DocumentIRNode document) - { - if (document == null) - { - throw new ArgumentNullException(nameof(document)); - } - - var visitor = new Visitor(); - return GetModelType(document, visitor); - } - - private static string GetModelType(DocumentIRNode document, Visitor visitor) - { - visitor.Visit(document); - - for (var i = visitor.ModelDirectives.Count - 1; i >= 0; i--) - { - var directive = visitor.ModelDirectives[i]; - - var tokens = directive.Tokens.ToArray(); - if (tokens.Length >= 1) - { - return tokens[0].Content; - } - } - - if (document.DocumentKind == RazorPageDocumentClassifierPass.RazorPageDocumentKind) - { - return visitor.Class.Name; - } - else - { - return "dynamic"; - } - } - - internal class Pass : RazorIRPassBase, IRazorDirectiveClassifierPass - { - // Runs after the @inherits directive - public override int Order => 5; - - public override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIRNode irDocument) - { - var visitor = new Visitor(); - var modelType = GetModelType(irDocument, visitor); - - var baseType = visitor.Class?.BaseType?.Replace("", "<" + modelType + ">"); - for (var i = visitor.InheritsDirectives.Count - 1; i >= 0; i--) - { - var directive = visitor.InheritsDirectives[i]; - var tokens = directive.Tokens.ToArray(); - if (tokens.Length >= 1) - { - baseType = tokens[0].Content.Replace("", "<" + modelType + ">"); - tokens[0].Content = baseType; - break; - } - } - - visitor.Class.BaseType = baseType; - } - } - - private class Visitor : RazorIRNodeWalker - { - public ClassDeclarationIRNode Class { get; private set; } - - public IList InheritsDirectives { get; } = new List(); - - public IList ModelDirectives { get; } = new List(); - - public override void VisitClass(ClassDeclarationIRNode node) - { - if (Class == null) - { - Class = node; - } - - base.VisitClass(node); - } - - public override void VisitDirective(DirectiveIRNode node) - { - if (node.Descriptor == Directive) - { - ModelDirectives.Add(node); - } - else if (node.Descriptor.Name == "inherits") - { - InheritsDirectives.Add(node); - } - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/ModelExpressionPass.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/ModelExpressionPass.cs deleted file mode 100644 index 9de73fbb4a..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/ModelExpressionPass.cs +++ /dev/null @@ -1,109 +0,0 @@ -// 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 System.Collections.Generic; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class ModelExpressionPass : RazorIRPassBase, IRazorIROptimizationPass - { - private const string ModelExpressionTypeName = "Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression"; - - public override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIRNode irDocument) - { - var visitor = new Visitor(); - visitor.Visit(irDocument); - } - - private class Visitor : RazorIRNodeWalker - { - public List TagHelpers { get; } = new List(); - - public override void VisitSetTagHelperProperty(SetTagHelperPropertyIRNode node) - { - if (string.Equals(node.Descriptor.TypeName, ModelExpressionTypeName, StringComparison.Ordinal) || - (node.IsIndexerNameMatch && - string.Equals(node.Descriptor.IndexerTypeName, ModelExpressionTypeName, StringComparison.Ordinal))) - { - var expression = new CSharpExpressionIRNode(); - var builder = RazorIRBuilder.Create(expression); - - builder.Add(new RazorIRToken() - { - Kind = RazorIRToken.TokenKind.CSharp, - Content = "ModelExpressionProvider.CreateModelExpression(ViewData, __model => ", - }); - - if (node.Children.Count == 1 && node.Children[0] is HtmlContentIRNode) - { - // A 'simple' expression will look like __model => __model.Foo - // - // Note that the fact we're looking for HTML here is based on a bug. - // https://github.com/aspnet/Razor/issues/963 - var original = ((HtmlContentIRNode)node.Children[0]); - - builder.Add(new RazorIRToken() - { - Kind = RazorIRToken.TokenKind.CSharp, - Content = "__model." - }); - - builder.Add(new RazorIRToken() - { - Kind = RazorIRToken.TokenKind.CSharp, - Content = original.Content, - Source = original.Source, - }); - } - else - { - for (var i = 0; i < node.Children.Count; i++) - { - var nestedExpression = node.Children[i] as CSharpExpressionIRNode; - if (nestedExpression != null) - { - for (var j = 0; j < nestedExpression.Children.Count; j++) - { - var cSharpToken = nestedExpression.Children[j] as RazorIRToken; - if (cSharpToken != null && cSharpToken.Kind == RazorIRToken.TokenKind.CSharp) - { - builder.Add(cSharpToken); - } - } - - continue; - } - - // Note that the fact we're looking for HTML here is based on a bug. - // https://github.com/aspnet/Razor/issues/963 - var html = node.Children[i] as HtmlContentIRNode; - if (html != null) - { - builder.Add(new RazorIRToken() - { - Kind = RazorIRToken.TokenKind.CSharp, - Content = html.Content, - Source = html.Source, - }); - } - } - } - - builder.Add(new RazorIRToken() - { - Kind = RazorIRToken.TokenKind.CSharp, - Content = ")", - }); - - node.Children.Clear(); - - node.Children.Add(expression); - expression.Parent = node; - } - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcRazorTemplateEngine.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcRazorTemplateEngine.cs deleted file mode 100644 index 89bec3a6bb..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcRazorTemplateEngine.cs +++ /dev/null @@ -1,64 +0,0 @@ -// 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.IO; -using System.Text; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Razor.Evolution; - -namespace Microsoft.AspNetCore.Mvc.Razor -{ - /// - /// A for Mvc Razor views. - /// - public class MvcRazorTemplateEngine : RazorTemplateEngine - { - /// - /// Initializes a new instance of . - /// - /// The . - /// The . - public MvcRazorTemplateEngine( - RazorEngine engine, - RazorProject project) - : base(engine, project) - { - Options.DefaultImports = GetDefaultImports(); - } - - /// - public override RazorCodeDocument CreateCodeDocument(RazorProjectItem projectItem) - { - var codeDocument = base.CreateCodeDocument(projectItem); - codeDocument.SetRelativePath(projectItem.Path); - - return codeDocument; - } - - private static RazorSourceDocument GetDefaultImports() - { - using (var stream = new MemoryStream()) - using (var writer = new StreamWriter(stream, Encoding.UTF8)) - { - writer.WriteLine("@using System"); - writer.WriteLine("@using System.Linq"); - writer.WriteLine("@using System.Collections.Generic"); - writer.WriteLine("@using Microsoft.AspNetCore.Mvc"); - writer.WriteLine("@using Microsoft.AspNetCore.Mvc.Rendering"); - writer.WriteLine("@using Microsoft.AspNetCore.Mvc.ViewFeatures"); - writer.WriteLine("@inject global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html"); - writer.WriteLine("@inject global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json"); - writer.WriteLine("@inject global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component"); - writer.WriteLine("@inject global::Microsoft.AspNetCore.Mvc.IUrlHelper Url"); - writer.WriteLine("@inject global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider"); - writer.WriteLine("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor"); - writer.WriteLine("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor"); - writer.WriteLine("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor"); - writer.Flush(); - - stream.Position = 0; - return RazorSourceDocument.ReadFrom(stream, fileName: null, encoding: Encoding.UTF8); - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcViewDocumentClassifierPass.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcViewDocumentClassifierPass.cs deleted file mode 100644 index 81fb630d7f..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/MvcViewDocumentClassifierPass.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class MvcViewDocumentClassifierPass : DocumentClassifierPassBase - { - public readonly string MvcViewDocumentKind = "mvc.1.0.view"; - - protected override string DocumentKind => MvcViewDocumentKind; - - protected override bool IsMatch(RazorCodeDocument codeDocument, DocumentIRNode irDocument) => true; - - protected override void OnDocumentStructureCreated( - RazorCodeDocument codeDocument, - NamespaceDeclarationIRNode @namespace, - ClassDeclarationIRNode @class, - RazorMethodDeclarationIRNode method) - { - var filePath = codeDocument.GetRelativePath() ?? codeDocument.Source.FileName; - - base.OnDocumentStructureCreated(codeDocument, @namespace, @class, method); - @class.Name = ClassName.GetClassNameFromPath(filePath); - @class.BaseType = "global::Microsoft.AspNetCore.Mvc.Razor.RazorPage"; - @class.AccessModifier = "public"; - @namespace.Content = "AspNetCore"; - method.Name = "ExecuteAsync"; - method.Modifiers = new[] { "async", "override" }; - method.AccessModifier = "public"; - method.ReturnType = $"global::{typeof(System.Threading.Tasks.Task).FullName}"; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/PageDirective.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/PageDirective.cs deleted file mode 100644 index df10aaeb7e..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/PageDirective.cs +++ /dev/null @@ -1,52 +0,0 @@ -// 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.Linq; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public static class PageDirective - { - public static readonly DirectiveDescriptor DirectiveDescriptor = DirectiveDescriptorBuilder - .Create("page") - .BeginOptionals() - .AddString() - .Build(); - - public static IRazorEngineBuilder Register(IRazorEngineBuilder builder) - { - builder.AddDirective(DirectiveDescriptor); - return builder; - } - - public static bool TryGetRouteTemplate(DocumentIRNode irDocument, out string routeTemplate) - { - var visitor = new Visitor(); - for (var i = 0; i < irDocument.Children.Count; i++) - { - visitor.Visit(irDocument.Children[i]); - } - - routeTemplate = visitor.RouteTemplate; - return visitor.DirectiveNode != null; - } - - private class Visitor : RazorIRNodeWalker - { - public DirectiveIRNode DirectiveNode { get; private set; } - - public string RouteTemplate { get; private set; } - - public override void VisitDirective(DirectiveIRNode node) - { - if (node.Descriptor == DirectiveDescriptor) - { - DirectiveNode = node; - RouteTemplate = node.Tokens.FirstOrDefault()?.Content; - } - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/PagesPropertyInjectionPass.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/PagesPropertyInjectionPass.cs deleted file mode 100644 index 939fad1e88..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/PagesPropertyInjectionPass.cs +++ /dev/null @@ -1,55 +0,0 @@ -// 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.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class PagesPropertyInjectionPass : RazorIRPassBase, IRazorIROptimizationPass - { - public override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIRNode irDocument) - { - if (irDocument.DocumentKind != RazorPageDocumentClassifierPass.RazorPageDocumentKind) - { - return; - } - - var modelType = ModelDirective.GetModelType(irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - var @class = visitor.Class; - - var viewDataType = $"global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<{modelType}>"; - var vddProperty = new CSharpStatementIRNode - { - Content = $"public {viewDataType} ViewData => ({viewDataType})PageContext?.ViewData;", - Parent = @class, - }; - var modelProperty = new CSharpStatementIRNode - { - Content = $"public {modelType} Model => ViewData.Model;", - Parent = @class, - }; - - @class.Children.Add(vddProperty); - @class.Children.Add(modelProperty); - } - - private class Visitor : RazorIRNodeWalker - { - public ClassDeclarationIRNode Class { get; private set; } - - public override void VisitClass(ClassDeclarationIRNode node) - { - if (Class == null) - { - Class = node; - } - - base.VisitClass(node); - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/Properties/AssemblyInfo.cs deleted file mode 100644 index 54c268e52d..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Razor.Host.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Properties/Resources.Designer.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/Properties/Resources.Designer.cs deleted file mode 100644 index c8f03d2aa7..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Properties/Resources.Designer.cs +++ /dev/null @@ -1,126 +0,0 @@ -// -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - using System.Globalization; - using System.Reflection; - using System.Resources; - - internal static class Resources - { - private static readonly ResourceManager _resourceManager - = new ResourceManager("Microsoft.AspNetCore.Mvc.Razor.Host.Resources", typeof(Resources).GetTypeInfo().Assembly); - - /// - /// Value cannot be null or empty. - /// - internal static string ArgumentCannotBeNullOrEmpy - { - get { return GetString("ArgumentCannotBeNullOrEmpy"); } - } - - /// - /// Value cannot be null or empty. - /// - internal static string FormatArgumentCannotBeNullOrEmpy() - { - return GetString("ArgumentCannotBeNullOrEmpy"); - } - - /// - /// The 'inherits' keyword is not allowed when a '{0}' keyword is used. - /// - internal static string MvcRazorCodeParser_CannotHaveModelAndInheritsKeyword - { - get { return GetString("MvcRazorCodeParser_CannotHaveModelAndInheritsKeyword"); } - } - - /// - /// The 'inherits' keyword is not allowed when a '{0}' keyword is used. - /// - internal static string FormatMvcRazorCodeParser_CannotHaveModelAndInheritsKeyword(object p0) - { - return string.Format(CultureInfo.CurrentCulture, GetString("MvcRazorCodeParser_CannotHaveModelAndInheritsKeyword"), p0); - } - - /// - /// A property name must be specified when using the '{0}' statement. Format for a '{0}' statement is '@{0} <Type Name> <Property Name>'. - /// - internal static string MvcRazorCodeParser_InjectDirectivePropertyNameRequired - { - get { return GetString("MvcRazorCodeParser_InjectDirectivePropertyNameRequired"); } - } - - /// - /// A property name must be specified when using the '{0}' statement. Format for a '{0}' statement is '@{0} <Type Name> <Property Name>'. - /// - internal static string FormatMvcRazorCodeParser_InjectDirectivePropertyNameRequired(object p0) - { - return string.Format(CultureInfo.CurrentCulture, GetString("MvcRazorCodeParser_InjectDirectivePropertyNameRequired"), p0); - } - - /// - /// The '{0}' keyword must be followed by a type name on the same line. - /// - internal static string MvcRazorCodeParser_KeywordMustBeFollowedByTypeName - { - get { return GetString("MvcRazorCodeParser_KeywordMustBeFollowedByTypeName"); } - } - - /// - /// The '{0}' keyword must be followed by a type name on the same line. - /// - internal static string FormatMvcRazorCodeParser_KeywordMustBeFollowedByTypeName(object p0) - { - return string.Format(CultureInfo.CurrentCulture, GetString("MvcRazorCodeParser_KeywordMustBeFollowedByTypeName"), p0); - } - - /// - /// Only one '{0}' statement is allowed in a file. - /// - internal static string MvcRazorCodeParser_OnlyOneModelStatementIsAllowed - { - get { return GetString("MvcRazorCodeParser_OnlyOneModelStatementIsAllowed"); } - } - - /// - /// Only one '{0}' statement is allowed in a file. - /// - internal static string FormatMvcRazorCodeParser_OnlyOneModelStatementIsAllowed(object p0) - { - return string.Format(CultureInfo.CurrentCulture, GetString("MvcRazorCodeParser_OnlyOneModelStatementIsAllowed"), p0); - } - - /// - /// Invalid tag helper property '{0}.{1}'. Dictionary values must not be of type '{2}'. - /// - internal static string MvcRazorParser_InvalidPropertyType - { - get { return GetString("MvcRazorParser_InvalidPropertyType"); } - } - - /// - /// Invalid tag helper property '{0}.{1}'. Dictionary values must not be of type '{2}'. - /// - internal static string FormatMvcRazorParser_InvalidPropertyType(object p0, object p1, object p2) - { - return string.Format(CultureInfo.CurrentCulture, GetString("MvcRazorParser_InvalidPropertyType"), p0, p1, p2); - } - - private static string GetString(string name, params string[] formatterNames) - { - var value = _resourceManager.GetString(name); - - System.Diagnostics.Debug.Assert(value != null); - - if (formatterNames != null) - { - for (var i = 0; i < formatterNames.Length; i++) - { - value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}"); - } - } - - return value; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/RazorPageDocumentClassifierPass.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/RazorPageDocumentClassifierPass.cs deleted file mode 100644 index 3996062968..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/RazorPageDocumentClassifierPass.cs +++ /dev/null @@ -1,41 +0,0 @@ -// 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.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class RazorPageDocumentClassifierPass : DocumentClassifierPassBase - { - public static readonly string RazorPageDocumentKind = "mvc.1.0.razor-page"; - - protected override string DocumentKind => RazorPageDocumentKind; - - protected override bool IsMatch(RazorCodeDocument codeDocument, DocumentIRNode irDocument) - { - string routePrefix; - return PageDirective.TryGetRouteTemplate(irDocument, out routePrefix); - } - - protected override void OnDocumentStructureCreated( - RazorCodeDocument codeDocument, - NamespaceDeclarationIRNode @namespace, - ClassDeclarationIRNode @class, - RazorMethodDeclarationIRNode method) - { - var filePath = codeDocument.GetRelativePath() ?? codeDocument.Source.FileName; - - base.OnDocumentStructureCreated(codeDocument, @namespace, @class, method); - @class.BaseType = "global::Microsoft.AspNetCore.Mvc.RazorPages.Page"; - @class.Name = ClassName.GetClassNameFromPath(filePath); - @class.AccessModifier = "public"; - @namespace.Content = "AspNetCore"; - method.Name = "ExecuteAsync"; - method.Modifiers = new[] { "async", "override" }; - method.AccessModifier = "public"; - method.ReturnType = $"global::{typeof(System.Threading.Tasks.Task).FullName}"; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Resources.resx b/src/Microsoft.AspNetCore.Mvc.Razor.Host/Resources.resx deleted file mode 100644 index a1c3afc652..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/Resources.resx +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Value cannot be null or empty. - - - The 'inherits' keyword is not allowed when a '{0}' keyword is used. - - - A property name must be specified when using the '{0}' statement. Format for a '{0}' statement is '@{0} <Type Name> <Property Name>'. - - - The '{0}' keyword must be followed by a type name on the same line. - - - Only one '{0}' statement is allowed in a file. - - - Invalid tag helper property '{0}.{1}'. Dictionary values must not be of type '{2}'. - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/ViewComponentTagHelperDescriptorConventions.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/ViewComponentTagHelperDescriptorConventions.cs deleted file mode 100644 index c35195bf59..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/ViewComponentTagHelperDescriptorConventions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// 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.Evolution; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - /// - /// A library of methods used to generate s for view components. - /// - public static class ViewComponentTagHelperDescriptorConventions - { - /// - /// The key in a containing - /// the short name of a view component. - /// - public static readonly string ViewComponentNameKey = "ViewComponentName"; - - /// - /// Indicates whether a represents a view component. - /// - /// The to check. - /// Whether a represents a view component. - public static bool IsViewComponentDescriptor(TagHelperDescriptor descriptor) => - descriptor != null && descriptor.Metadata.ContainsKey(ViewComponentNameKey); - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/ViewComponentTagHelperPass.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Host/ViewComponentTagHelperPass.cs deleted file mode 100644 index 1f7ec7080a..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/ViewComponentTagHelperPass.cs +++ /dev/null @@ -1,276 +0,0 @@ -// 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.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; -using Microsoft.AspNetCore.Razor.Evolution.Legacy; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class ViewComponentTagHelperPass : RazorIRPassBase, IRazorIROptimizationPass - { - public override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIRNode irDocument) - { - var visitor = new Visitor(); - visitor.Visit(irDocument); - - if (visitor.Class == null || visitor.TagHelpers.Count == 0) - { - // Nothing to do, bail. - return; - } - - foreach (var tagHelper in visitor.TagHelpers) - { - GenerateVCTHClass(visitor.Class, tagHelper.Value); - - var tagHelperTypeName = tagHelper.Value.Metadata[ITagHelperDescriptorBuilder.TypeNameKey]; - if (visitor.Fields.UsedTagHelperTypeNames.Remove(tagHelperTypeName)) - { - visitor.Fields.UsedTagHelperTypeNames.Add(GetVCTHFullName(visitor.Namespace, visitor.Class, tagHelper.Value)); - } - } - - foreach (var createNode in visitor.CreateTagHelpers) - { - RewriteCreateNode(visitor.Namespace, visitor.Class, createNode); - } - } - - private void GenerateVCTHClass(ClassDeclarationIRNode @class, TagHelperDescriptor tagHelper) - { - var writer = new CSharpCodeWriter(); - WriteClass(writer, tagHelper); - - @class.Children.Add(new CSharpStatementIRNode() - { - Content = writer.Builder.ToString(), - Parent = @class, - }); - } - - private void RewriteCreateNode( - NamespaceDeclarationIRNode @namespace, - ClassDeclarationIRNode @class, - CreateTagHelperIRNode node) - { - var originalTypeName = node.TagHelperTypeName; - - var newTypeName = GetVCTHFullName(@namespace, @class, node.Descriptor); - for (var i = 0; i < node.Parent.Children.Count; i++) - { - var setProperty = node.Parent.Children[i] as SetTagHelperPropertyIRNode; - if (setProperty != null) - { - setProperty.TagHelperTypeName = newTypeName; - } - } - - node.TagHelperTypeName = newTypeName; - } - - private static string GetVCTHFullName( - NamespaceDeclarationIRNode @namespace, - ClassDeclarationIRNode @class, - TagHelperDescriptor tagHelper) - { - var vcName = tagHelper.Metadata[ViewComponentTagHelperDescriptorConventions.ViewComponentNameKey]; - return $"{@namespace.Content}.{@class.Name}.__Generated__{vcName}ViewComponentTagHelper"; - } - - private static string GetVCTHClassName( - TagHelperDescriptor tagHelper) - { - var vcName = tagHelper.Metadata[ViewComponentTagHelperDescriptorConventions.ViewComponentNameKey]; - return $"__Generated__{vcName}ViewComponentTagHelper"; - } - - private void WriteClass(CSharpCodeWriter writer, TagHelperDescriptor descriptor) - { - // Add target element. - BuildTargetElementString(writer, descriptor); - - // Initialize declaration. - var tagHelperTypeName = "Microsoft.AspNetCore.Razor.TagHelpers.TagHelper"; - var className = GetVCTHClassName(descriptor); - - using (writer.BuildClassDeclaration("public", className, new[] { tagHelperTypeName })) - { - // Add view component helper. - writer.WriteVariableDeclaration( - $"private readonly global::Microsoft.AspNetCore.Mvc.IViewComponentHelper", - "_helper", - value: null); - - // Add constructor. - BuildConstructorString(writer, className); - - // Add attributes. - BuildAttributeDeclarations(writer, descriptor); - - // Add process method. - BuildProcessMethodString(writer, descriptor); - } - } - - private void BuildConstructorString(CSharpCodeWriter writer, string className) - { - var helperPair = new KeyValuePair( - $"global::Microsoft.AspNetCore.Mvc.IViewComponentHelper", - "helper"); - - using (writer.BuildConstructor("public", className, new[] { helperPair })) - { - writer.WriteStartAssignment("_helper") - .Write("helper") - .WriteLine(";"); - } - } - - private void BuildAttributeDeclarations(CSharpCodeWriter writer, TagHelperDescriptor descriptor) - { - writer.Write("[") - .Write("Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeNotBoundAttribute") - .WriteParameterSeparator() - .Write($"global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewContextAttribute") - .WriteLine("]"); - - writer.WriteAutoPropertyDeclaration( - "public", - $"global::Microsoft.AspNetCore.Mvc.Rendering.ViewContext", - "ViewContext"); - - foreach (var attribute in descriptor.BoundAttributes) - { - writer.WriteAutoPropertyDeclaration( - "public", attribute.TypeName, attribute.Metadata[ITagHelperBoundAttributeDescriptorBuilder.PropertyNameKey]); - - if (attribute.IndexerTypeName != null) - { - writer.Write(" = ") - .WriteStartNewObject(attribute.TypeName) - .WriteEndMethodInvocation(); - } - } - } - - private void BuildProcessMethodString(CSharpCodeWriter writer, TagHelperDescriptor descriptor) - { - var contextVariable = "context"; - var outputVariable = "output"; - - using (writer.BuildMethodDeclaration( - $"public override async", - $"global::{typeof(Task).FullName}", - "ProcessAsync", - new Dictionary() - { - { "Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext", contextVariable }, - { "Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput", outputVariable } - })) - { - writer.WriteInstanceMethodInvocation( - $"(_helper as global::Microsoft.AspNetCore.Mvc.ViewFeatures.IViewContextAware)?", - "Contextualize", - new[] { "ViewContext" }); - - var methodParameters = GetMethodParameters(descriptor); - var contentVariable = "content"; - writer.Write("var ") - .WriteStartAssignment(contentVariable) - .WriteInstanceMethodInvocation($"await _helper", "InvokeAsync", methodParameters); - writer.WriteStartAssignment($"{outputVariable}.TagName") - .WriteLine("null;"); - writer.WriteInstanceMethodInvocation( - $"{outputVariable}.Content", - "SetHtmlContent", - new[] { contentVariable }); - } - } - - private string[] GetMethodParameters(TagHelperDescriptor descriptor) - { - var propertyNames = descriptor.BoundAttributes.Select( - attribute => attribute.Metadata[ITagHelperBoundAttributeDescriptorBuilder.PropertyNameKey]); - var joinedPropertyNames = string.Join(", ", propertyNames); - var parametersString = $"new {{ { joinedPropertyNames } }}"; - - var viewComponentName = descriptor.Metadata[ - ViewComponentTagHelperDescriptorConventions.ViewComponentNameKey]; - var methodParameters = new[] { $"\"{viewComponentName}\"", parametersString }; - return methodParameters; - } - - private void BuildTargetElementString(CSharpCodeWriter writer, TagHelperDescriptor descriptor) - { - Debug.Assert(descriptor.TagMatchingRules.Count() == 1); - - var rule = descriptor.TagMatchingRules.First(); - - writer.Write("[") - .WriteStartMethodInvocation("Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute") - .WriteStringLiteral(rule.TagName) - .WriteLine(")]"); - } - - private class Visitor : RazorIRNodeWalker - { - public ClassDeclarationIRNode Class { get; private set; } - - public DeclareTagHelperFieldsIRNode Fields { get; private set; } - - public NamespaceDeclarationIRNode Namespace { get; private set; } - - public List CreateTagHelpers { get; } = new List(); - - public Dictionary TagHelpers { get; } = new Dictionary(); - - public override void VisitCreateTagHelper(CreateTagHelperIRNode node) - { - var tagHelper = node.Descriptor; - if (ViewComponentTagHelperDescriptorConventions.IsViewComponentDescriptor(tagHelper)) - { - // Capture all the VCTagHelpers (unique by type name) so we can generate a class for each one. - var vcName = tagHelper.Metadata[ViewComponentTagHelperDescriptorConventions.ViewComponentNameKey]; - TagHelpers[vcName] = tagHelper; - - CreateTagHelpers.Add(node); - } - } - - public override void VisitNamespace(NamespaceDeclarationIRNode node) - { - if (Namespace == null) - { - Namespace = node; - } - - base.VisitNamespace(node); - } - - public override void VisitClass(ClassDeclarationIRNode node) - { - if (Class == null) - { - Class = node; - } - - base.VisitClass(node); - } - - public override void VisitDeclareTagHelperFields(DeclareTagHelperFieldsIRNode node) - { - if (Fields == null) - { - Fields = node; - } - - base.VisitDeclareTagHelperFields(node); - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/baseline.net45.json b/src/Microsoft.AspNetCore.Mvc.Razor.Host/baseline.net45.json deleted file mode 100644 index 076b78c730..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/baseline.net45.json +++ /dev/null @@ -1,1689 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.AspNetCore.Mvc.Razor.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - { - "Name": "Microsoft.AspNetCore.Razor.Generator.ModelChunkGenerator", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Chunks.Generators.SpanChunkGenerator", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ModelType", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateChunk", - "Parameters": [ - { - "Name": "target", - "Type": "Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Span" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Generators.ChunkGeneratorContext" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Razor.Chunks.Generators.ISpanChunkGenerator", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ToString", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Equals", - "Parameters": [ - { - "Name": "obj", - "Type": "System.Object" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetHashCode", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelType", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.GeneratedTagHelperAttributeContext", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ModelExpressionTypeName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ModelExpressionTypeName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_CreateModelExpressionMethodName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_CreateModelExpressionMethodName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ModelExpressionProviderPropertyName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ModelExpressionProviderPropertyName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ViewDataPropertyName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ViewDataPropertyName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GenerateCode", - "Parameters": [ - { - "Name": "rootRelativePath", - "Type": "System.String" - }, - { - "Name": "inputStream", - "Type": "System.IO.Stream" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.GeneratorResults", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultNamespace", - "Parameters": [], - "ReturnType": "System.String", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.InjectChunk", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Chunks.Chunk", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_TypeName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_TypeName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_MemberName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_MemberName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "typeName", - "Type": "System.String" - }, - { - "Name": "propertyName", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.InjectChunkVisitor", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeVisitor", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_InjectChunks", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IList", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Visit", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Mvc.Razor.InjectChunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - }, - { - "Name": "injectAttributeName", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.InjectParameterGenerator", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Chunks.Generators.SpanChunkGenerator", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_TypeName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_PropertyName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateChunk", - "Parameters": [ - { - "Name": "target", - "Type": "Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Span" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Generators.ChunkGeneratorContext" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Razor.Chunks.Generators.ISpanChunkGenerator", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ToString", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Equals", - "Parameters": [ - { - "Name": "obj", - "Type": "System.Object" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetHashCode", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "typeName", - "Type": "System.String" - }, - { - "Name": "propertyName", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.ModelChunk", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Chunks.Chunk", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ModelType", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelType", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpChunkVisitor", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "BaseType": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CodeVisitor", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Accept", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.IChunkVisitor", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Visit", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Mvc.Razor.InjectChunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Abstract": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeGenerator", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeGenerator", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "BuildClassDeclaration", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWritingScope", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateCSharpCodeVisitor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpCodeVisitor", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateCSharpDesignTimeCodeVisitor", - "Parameters": [ - { - "Name": "csharpCodeVisitor", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpCodeVisitor" - }, - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpDesignTimeCodeVisitor", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "BuildConstructor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - }, - { - "Name": "defaultModel", - "Type": "System.String" - }, - { - "Name": "injectAttribute", - "Type": "System.String" - }, - { - "Name": "tagHelperAttributeContext", - "Type": "Microsoft.AspNetCore.Mvc.Razor.GeneratedTagHelperAttributeContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeVisitor", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "BaseType": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpChunkVisitor", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Visit", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Mvc.Razor.InjectChunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpDesignTimeCodeVisitor", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpDesignTimeCodeVisitor", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "AcceptTreeCore", - "Parameters": [ - { - "Name": "tree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Accept", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.IChunkVisitor", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "csharpCodeVisitor", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpCodeVisitor" - }, - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcRazorCodeParser", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Parser.CSharpCodeParser", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "InheritsDirective", - "Parameters": [], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ModelDirective", - "Parameters": [], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "InjectDirective", - "Parameters": [], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.RazorEngineHost", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_TagHelperDescriptorResolver", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Razor.Compilation.TagHelpers.ITagHelperDescriptorResolver", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_TagHelperDescriptorResolver", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Razor.Compilation.TagHelpers.ITagHelperDescriptorResolver" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultModel", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultInheritedChunks", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IReadOnlyList", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_InjectAttribute", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ModelExpressionType", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_CreateModelExpressionMethod", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ModelExpressionProvider", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ViewDataPropertyName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetInheritedChunkTreeResults", - "Parameters": [ - { - "Name": "sourceFileName", - "Type": "System.String" - } - ], - "ReturnType": "System.Collections.Generic.IReadOnlyList", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateCode", - "Parameters": [ - { - "Name": "rootRelativePath", - "Type": "System.String" - }, - { - "Name": "inputStream", - "Type": "System.IO.Stream" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.GeneratorResults", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "DecorateRazorParser", - "Parameters": [ - { - "Name": "razorParser", - "Type": "Microsoft.AspNetCore.Razor.Parser.RazorParser" - }, - { - "Name": "sourceFileName", - "Type": "System.String" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.Parser.RazorParser", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "DecorateCodeParser", - "Parameters": [ - { - "Name": "incomingCodeParser", - "Type": "Microsoft.AspNetCore.Razor.Parser.ParserBase" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.Parser.ParserBase", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "DecorateCodeGenerator", - "Parameters": [ - { - "Name": "incomingGenerator", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGenerator" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGenerator", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "root", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "chunkTreeCache", - "Type": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache" - }, - { - "Name": "resolver", - "Type": "Microsoft.AspNetCore.Razor.Compilation.TagHelpers.ITagHelperDescriptorResolver" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcRazorParser", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Parser.RazorParser", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetTagHelperDescriptors", - "Parameters": [ - { - "Name": "documentRoot", - "Type": "Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block" - }, - { - "Name": "errorSink", - "Type": "Microsoft.AspNetCore.Razor.ErrorSink" - } - ], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "parser", - "Type": "Microsoft.AspNetCore.Razor.Parser.RazorParser" - }, - { - "Name": "inheritedChunkTrees", - "Type": "System.Collections.Generic.IReadOnlyList" - }, - { - "Name": "defaultInheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - }, - { - "Name": "modelExpressionTypeName", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcTagHelperAttributeValueCodeRenderer", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.CodeGenerators.TagHelperAttributeValueCodeRenderer", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "RenderAttributeValue", - "Parameters": [ - { - "Name": "attributeDescriptor", - "Type": "Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor" - }, - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "codeGeneratorContext", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - }, - { - "Name": "renderAttributeValue", - "Type": "System.Action" - }, - { - "Name": "complexValue", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.Razor.GeneratedTagHelperAttributeContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.ViewHierarchyUtility", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetViewStartLocations", - "Parameters": [ - { - "Name": "applicationRelativePath", - "Type": "System.String" - } - ], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetViewImportsLocations", - "Parameters": [ - { - "Name": "applicationRelativePath", - "Type": "System.String" - } - ], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "ViewImportsFileName", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Internal.DesignTimeRazorPathNormalizer", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.Razor.Internal.RazorPathNormalizer", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "NormalizePath", - "Parameters": [ - { - "Name": "path", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "applicationRoot", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Internal.RazorPathNormalizer", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "NormalizePath", - "Parameters": [ - { - "Name": "path", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkHelper", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetModelChunk", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.Razor.ModelChunk", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetModelTypeName", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "defaultModelName", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ReplaceTModel", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - }, - { - "Name": "modelName", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "TModelToken", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkInheritanceUtility", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetInheritedChunkTreeResults", - "Parameters": [ - { - "Name": "pagePath", - "Type": "System.String" - } - ], - "ReturnType": "System.Collections.Generic.IReadOnlyList", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunkTrees", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunkTrees", - "Type": "System.Collections.Generic.IReadOnlyList" - }, - { - "Name": "defaultModel", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "razorHost", - "Type": "Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost" - }, - { - "Name": "chunkTreeCache", - "Type": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache" - }, - { - "Name": "defaultInheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkTreeResult", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ChunkTree", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_FilePath", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "filePath", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.DefaultChunkTreeCache", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache" - ], - "Members": [ - { - "Kind": "Method", - "Name": "GetOrAdd", - "Parameters": [ - { - "Name": "pagePath", - "Type": "System.String" - }, - { - "Name": "getChunkTree", - "Type": "System.Func" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Dispose", - "Parameters": [], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "System.IDisposable", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "fileProvider", - "Type": "Microsoft.Extensions.FileProviders.IFileProvider" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "VisitChunk", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunks", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "ReturnType": "System.Void", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [ - "System.IDisposable" - ], - "Members": [ - { - "Kind": "Method", - "Name": "GetOrAdd", - "Parameters": [ - { - "Name": "pagePath", - "Type": "System.String" - }, - { - "Name": "getChunkTree", - "Type": "System.Func" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.InjectChunkMerger", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger" - ], - "Members": [ - { - "Kind": "Method", - "Name": "VisitChunk", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunks", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelType", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.SetBaseTypeChunkMerger", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger" - ], - "Members": [ - { - "Kind": "Method", - "Name": "VisitChunk", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunks", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelType", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.UsingChunkMerger", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger" - ], - "Members": [ - { - "Kind": "Method", - "Name": "VisitChunk", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunks", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - } - ] -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/baseline.netcore.json b/src/Microsoft.AspNetCore.Mvc.Razor.Host/baseline.netcore.json deleted file mode 100644 index d232af246c..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/baseline.netcore.json +++ /dev/null @@ -1,1677 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.AspNetCore.Mvc.Razor.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - { - "Name": "Microsoft.AspNetCore.Razor.Generator.ModelChunkGenerator", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Chunks.Generators.SpanChunkGenerator", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ModelType", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateChunk", - "Parameters": [ - { - "Name": "target", - "Type": "Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Span" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Generators.ChunkGeneratorContext" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Razor.Chunks.Generators.ISpanChunkGenerator", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ToString", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Equals", - "Parameters": [ - { - "Name": "obj", - "Type": "System.Object" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetHashCode", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelType", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.GeneratedTagHelperAttributeContext", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ModelExpressionTypeName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ModelExpressionTypeName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_CreateModelExpressionMethodName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_CreateModelExpressionMethodName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ModelExpressionProviderPropertyName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ModelExpressionProviderPropertyName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ViewDataPropertyName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ViewDataPropertyName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GenerateCode", - "Parameters": [ - { - "Name": "rootRelativePath", - "Type": "System.String" - }, - { - "Name": "inputStream", - "Type": "System.IO.Stream" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.GeneratorResults", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultNamespace", - "Parameters": [], - "ReturnType": "System.String", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.InjectChunk", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Chunks.Chunk", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_TypeName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_TypeName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_MemberName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_MemberName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "typeName", - "Type": "System.String" - }, - { - "Name": "propertyName", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.InjectChunkVisitor", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeVisitor", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_InjectChunks", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IList", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Visit", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Mvc.Razor.InjectChunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - }, - { - "Name": "injectAttributeName", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.InjectParameterGenerator", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Chunks.Generators.SpanChunkGenerator", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_TypeName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_PropertyName", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateChunk", - "Parameters": [ - { - "Name": "target", - "Type": "Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Span" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Generators.ChunkGeneratorContext" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Razor.Chunks.Generators.ISpanChunkGenerator", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ToString", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Equals", - "Parameters": [ - { - "Name": "obj", - "Type": "System.Object" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetHashCode", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "typeName", - "Type": "System.String" - }, - { - "Name": "propertyName", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.ModelChunk", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Chunks.Chunk", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ModelType", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelType", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpChunkVisitor", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "BaseType": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CodeVisitor", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Accept", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.IChunkVisitor", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Visit", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Mvc.Razor.InjectChunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Abstract": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeGenerator", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeGenerator", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "BuildClassDeclaration", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWritingScope", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateCSharpCodeVisitor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpCodeVisitor", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateCSharpDesignTimeCodeVisitor", - "Parameters": [ - { - "Name": "csharpCodeVisitor", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpCodeVisitor" - }, - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpDesignTimeCodeVisitor", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "BuildConstructor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - }, - { - "Name": "defaultModel", - "Type": "System.String" - }, - { - "Name": "injectAttribute", - "Type": "System.String" - }, - { - "Name": "tagHelperAttributeContext", - "Type": "Microsoft.AspNetCore.Mvc.Razor.GeneratedTagHelperAttributeContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeVisitor", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "BaseType": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpChunkVisitor", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Visit", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Mvc.Razor.InjectChunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcCSharpDesignTimeCodeVisitor", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpDesignTimeCodeVisitor", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "AcceptTreeCore", - "Parameters": [ - { - "Name": "tree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Accept", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.IChunkVisitor", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "csharpCodeVisitor", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpCodeVisitor" - }, - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcRazorCodeParser", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Parser.CSharpCodeParser", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "InheritsDirective", - "Parameters": [], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ModelDirective", - "Parameters": [], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "InjectDirective", - "Parameters": [], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.RazorEngineHost", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_TagHelperDescriptorResolver", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Razor.Compilation.TagHelpers.ITagHelperDescriptorResolver", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_TagHelperDescriptorResolver", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Razor.Compilation.TagHelpers.ITagHelperDescriptorResolver" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultModel", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultInheritedChunks", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IReadOnlyList", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_InjectAttribute", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ModelExpressionType", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_CreateModelExpressionMethod", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ModelExpressionProvider", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ViewDataPropertyName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetInheritedChunkTreeResults", - "Parameters": [ - { - "Name": "sourceFileName", - "Type": "System.String" - } - ], - "ReturnType": "System.Collections.Generic.IReadOnlyList", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateCode", - "Parameters": [ - { - "Name": "rootRelativePath", - "Type": "System.String" - }, - { - "Name": "inputStream", - "Type": "System.IO.Stream" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.GeneratorResults", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "DecorateRazorParser", - "Parameters": [ - { - "Name": "razorParser", - "Type": "Microsoft.AspNetCore.Razor.Parser.RazorParser" - }, - { - "Name": "sourceFileName", - "Type": "System.String" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.Parser.RazorParser", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "DecorateCodeParser", - "Parameters": [ - { - "Name": "incomingCodeParser", - "Type": "Microsoft.AspNetCore.Razor.Parser.ParserBase" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.Parser.ParserBase", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "DecorateCodeGenerator", - "Parameters": [ - { - "Name": "incomingGenerator", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGenerator" - }, - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGenerator", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "chunkTreeCache", - "Type": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache" - }, - { - "Name": "resolver", - "Type": "Microsoft.AspNetCore.Razor.Compilation.TagHelpers.ITagHelperDescriptorResolver" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcRazorParser", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.Parser.RazorParser", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetTagHelperDescriptors", - "Parameters": [ - { - "Name": "documentRoot", - "Type": "Microsoft.AspNetCore.Razor.Parser.SyntaxTree.Block" - }, - { - "Name": "errorSink", - "Type": "Microsoft.AspNetCore.Razor.ErrorSink" - } - ], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Virtual": true, - "Override": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "parser", - "Type": "Microsoft.AspNetCore.Razor.Parser.RazorParser" - }, - { - "Name": "inheritedChunkTrees", - "Type": "System.Collections.Generic.IReadOnlyList" - }, - { - "Name": "defaultInheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - }, - { - "Name": "modelExpressionTypeName", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.MvcTagHelperAttributeValueCodeRenderer", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Razor.CodeGenerators.TagHelperAttributeValueCodeRenderer", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "RenderAttributeValue", - "Parameters": [ - { - "Name": "attributeDescriptor", - "Type": "Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor" - }, - { - "Name": "writer", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter" - }, - { - "Name": "codeGeneratorContext", - "Type": "Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext" - }, - { - "Name": "renderAttributeValue", - "Type": "System.Action" - }, - { - "Name": "complexValue", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.Razor.GeneratedTagHelperAttributeContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.ViewHierarchyUtility", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetViewStartLocations", - "Parameters": [ - { - "Name": "applicationRelativePath", - "Type": "System.String" - } - ], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetViewImportsLocations", - "Parameters": [ - { - "Name": "applicationRelativePath", - "Type": "System.String" - } - ], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "ViewImportsFileName", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Internal.DesignTimeRazorPathNormalizer", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.Razor.Internal.RazorPathNormalizer", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "NormalizePath", - "Parameters": [ - { - "Name": "path", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "applicationRoot", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Internal.RazorPathNormalizer", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "NormalizePath", - "Parameters": [ - { - "Name": "path", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkHelper", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetModelChunk", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.Razor.ModelChunk", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetModelTypeName", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "defaultModelName", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ReplaceTModel", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - }, - { - "Name": "modelName", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "TModelToken", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkInheritanceUtility", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetInheritedChunkTreeResults", - "Parameters": [ - { - "Name": "pagePath", - "Type": "System.String" - } - ], - "ReturnType": "System.Collections.Generic.IReadOnlyList", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunkTrees", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunkTrees", - "Type": "System.Collections.Generic.IReadOnlyList" - }, - { - "Name": "defaultModel", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "razorHost", - "Type": "Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost" - }, - { - "Name": "chunkTreeCache", - "Type": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache" - }, - { - "Name": "defaultInheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkTreeResult", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ChunkTree", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_FilePath", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "filePath", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.DefaultChunkTreeCache", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache" - ], - "Members": [ - { - "Kind": "Method", - "Name": "GetOrAdd", - "Parameters": [ - { - "Name": "pagePath", - "Type": "System.String" - }, - { - "Name": "getChunkTree", - "Type": "System.Func" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Dispose", - "Parameters": [], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "System.IDisposable", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "fileProvider", - "Type": "Microsoft.Extensions.FileProviders.IFileProvider" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "VisitChunk", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunks", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "ReturnType": "System.Void", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [ - "System.IDisposable" - ], - "Members": [ - { - "Kind": "Method", - "Name": "GetOrAdd", - "Parameters": [ - { - "Name": "pagePath", - "Type": "System.String" - }, - { - "Name": "getChunkTree", - "Type": "System.Func" - } - ], - "ReturnType": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.InjectChunkMerger", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger" - ], - "Members": [ - { - "Kind": "Method", - "Name": "VisitChunk", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunks", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelType", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.SetBaseTypeChunkMerger", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger" - ], - "Members": [ - { - "Kind": "Method", - "Name": "VisitChunk", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunks", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelType", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.Razor.Directives.UsingChunkMerger", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger" - ], - "Members": [ - { - "Kind": "Method", - "Name": "VisitChunk", - "Parameters": [ - { - "Name": "chunk", - "Type": "Microsoft.AspNetCore.Razor.Chunks.Chunk" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MergeInheritedChunks", - "Parameters": [ - { - "Name": "chunkTree", - "Type": "Microsoft.AspNetCore.Razor.Chunks.ChunkTree" - }, - { - "Name": "inheritedChunks", - "Type": "System.Collections.Generic.IReadOnlyList" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - } - ] -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/exceptions.net45.json b/src/Microsoft.AspNetCore.Mvc.Razor.Host/exceptions.net45.json deleted file mode 100644 index 3ca07cfc87..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/exceptions.net45.json +++ /dev/null @@ -1,98 +0,0 @@ -[ - { - "OldTypeId": "public interface Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.ModelChunk : Microsoft.AspNetCore.Razor.Chunks.Chunk", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Razor.Generator.ModelChunkGenerator : Microsoft.AspNetCore.Razor.Chunks.Generators.SpanChunkGenerator", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.InjectChunk : Microsoft.AspNetCore.Razor.Chunks.Chunk", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.InjectChunkVisitor : Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeVisitor", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.InjectParameterGenerator : Microsoft.AspNetCore.Razor.Chunks.Generators.SpanChunkGenerator", - "Kind": "Removal" - }, - { - "OldTypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.MvcCSharpChunkVisitor : Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CodeVisitor", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeGenerator : Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeGenerator", - "Kind": "Removal" - }, - { - "OldTypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeVisitor : Microsoft.AspNetCore.Mvc.Razor.MvcCSharpChunkVisitor", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcCSharpDesignTimeCodeVisitor : Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpDesignTimeCodeVisitor", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcRazorCodeParser : Microsoft.AspNetCore.Razor.Parser.CSharpCodeParser", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcRazorParser : Microsoft.AspNetCore.Razor.Parser.RazorParser", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost : Microsoft.AspNetCore.Razor.RazorEngineHost, Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcTagHelperAttributeValueCodeRenderer : Microsoft.AspNetCore.Razor.CodeGenerators.TagHelperAttributeValueCodeRenderer", - "Kind": "Removal" - }, - { - "OldTypeId": "public static class Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkHelper", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkInheritanceUtility", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkTreeResult", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.DefaultChunkTreeCache : Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache", - "Kind": "Removal" - }, - { - "OldTypeId": "public interface Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Kind": "Removal" - }, - { - "OldTypeId": "public interface Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache : System.IDisposable", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.InjectChunkMerger : Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.SetBaseTypeChunkMerger : Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.UsingChunkMerger : Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.GeneratedTagHelperAttributeContext", - "Kind": "Removal" - } -] \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Host/exceptions.netcore.json b/src/Microsoft.AspNetCore.Mvc.Razor.Host/exceptions.netcore.json deleted file mode 100644 index 3ca07cfc87..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Host/exceptions.netcore.json +++ /dev/null @@ -1,98 +0,0 @@ -[ - { - "OldTypeId": "public interface Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.ModelChunk : Microsoft.AspNetCore.Razor.Chunks.Chunk", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Razor.Generator.ModelChunkGenerator : Microsoft.AspNetCore.Razor.Chunks.Generators.SpanChunkGenerator", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.InjectChunk : Microsoft.AspNetCore.Razor.Chunks.Chunk", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.InjectChunkVisitor : Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeVisitor", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.InjectParameterGenerator : Microsoft.AspNetCore.Razor.Chunks.Generators.SpanChunkGenerator", - "Kind": "Removal" - }, - { - "OldTypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.MvcCSharpChunkVisitor : Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CodeVisitor", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeGenerator : Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeGenerator", - "Kind": "Removal" - }, - { - "OldTypeId": "public abstract class Microsoft.AspNetCore.Mvc.Razor.MvcCSharpCodeVisitor : Microsoft.AspNetCore.Mvc.Razor.MvcCSharpChunkVisitor", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcCSharpDesignTimeCodeVisitor : Microsoft.AspNetCore.Razor.CodeGenerators.Visitors.CSharpDesignTimeCodeVisitor", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcRazorCodeParser : Microsoft.AspNetCore.Razor.Parser.CSharpCodeParser", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcRazorParser : Microsoft.AspNetCore.Razor.Parser.RazorParser", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost : Microsoft.AspNetCore.Razor.RazorEngineHost, Microsoft.AspNetCore.Mvc.Razor.IMvcRazorHost", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.MvcTagHelperAttributeValueCodeRenderer : Microsoft.AspNetCore.Razor.CodeGenerators.TagHelperAttributeValueCodeRenderer", - "Kind": "Removal" - }, - { - "OldTypeId": "public static class Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkHelper", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkInheritanceUtility", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkTreeResult", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.DefaultChunkTreeCache : Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache", - "Kind": "Removal" - }, - { - "OldTypeId": "public interface Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Kind": "Removal" - }, - { - "OldTypeId": "public interface Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache : System.IDisposable", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.InjectChunkMerger : Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.SetBaseTypeChunkMerger : Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.Directives.UsingChunkMerger : Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkMerger", - "Kind": "Removal" - }, - { - "OldTypeId": "public class Microsoft.AspNetCore.Mvc.Razor.GeneratedTagHelperAttributeContext", - "Kind": "Removal" - } -] \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/DependencyInjection/MvcRazorMvcCoreBuilderExtensions.cs b/src/Microsoft.AspNetCore.Mvc.Razor/DependencyInjection/MvcRazorMvcCoreBuilderExtensions.cs index d98a797cf1..e1039f376a 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/DependencyInjection/MvcRazorMvcCoreBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/DependencyInjection/MvcRazorMvcCoreBuilderExtensions.cs @@ -6,12 +6,10 @@ using System.Linq; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.AspNetCore.Mvc.Razor.Compilation; -using Microsoft.AspNetCore.Mvc.Razor.Host; +using Microsoft.AspNetCore.Mvc.Razor.Extensions; using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Mvc.Razor.TagHelpers; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Runtime.TagHelpers; using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.DependencyInjection.Extensions; diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRazorPageFactoryProvider.cs b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRazorPageFactoryProvider.cs index 8c122feb23..150c07393d 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRazorPageFactoryProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRazorPageFactoryProvider.cs @@ -5,6 +5,7 @@ using System; using System.Linq.Expressions; using System.Reflection; using Microsoft.AspNetCore.Mvc.Razor.Compilation; +using Microsoft.AspNetCore.Mvc.Razor.Extensions; using Microsoft.AspNetCore.Razor.Evolution; namespace Microsoft.AspNetCore.Mvc.Razor.Internal diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorCompiler.cs b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorCompiler.cs index 873901b1f5..79a6cf14da 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorCompiler.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorCompiler.cs @@ -8,6 +8,7 @@ using System.Linq; using Microsoft.AspNetCore.Diagnostics; using Microsoft.AspNetCore.Mvc.Razor.Compilation; using Microsoft.AspNetCore.Razor.Evolution; +using Microsoft.AspNetCore.Mvc.Razor.Extensions; namespace Microsoft.AspNetCore.Mvc.Razor.Internal { diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.csproj b/src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.csproj index 1c6cba58fe..f6b8d62470 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.csproj +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Microsoft.AspNetCore.Mvc.Razor.csproj @@ -12,12 +12,13 @@ - + + diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngineOptions.cs b/src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngineOptions.cs index 3f016b69ca..9319e74cbf 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngineOptions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngineOptions.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Razor.Compilation; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -31,8 +32,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor /// locate Razor files. /// /// - /// At startup, this is initialized to include an instance of that is - /// rooted at the application root. + /// At startup, this is initialized to include an instance of + /// that is rooted at the application root. /// public IList FileProviders { get; } = new List(); diff --git a/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/DefaultPageLoader.cs b/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/DefaultPageLoader.cs index ed12fbfac3..e44b5a61d8 100644 --- a/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/DefaultPageLoader.cs +++ b/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/DefaultPageLoader.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; -using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.AspNetCore.Mvc.Razor.Compilation; +using Microsoft.AspNetCore.Mvc.Razor.Extensions; using Microsoft.AspNetCore.Mvc.Razor.Internal; using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; using Microsoft.AspNetCore.Razor.Evolution; diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/DictionaryPrefixTestTagHelper.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/DictionaryPrefixTestTagHelper.cs deleted file mode 100644 index d64e8d8d19..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/DictionaryPrefixTestTagHelper.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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.Collections.Generic; -using Microsoft.AspNetCore.Mvc.ViewFeatures; -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace Microsoft.AspNetCore.Mvc.Razor -{ - [HtmlTargetElement(Attributes = "prefix-*")] - public class DictionaryPrefixTestTagHelper : TagHelper - { - [HtmlAttributeName(DictionaryAttributePrefix = "prefix-")] - public IDictionary PrefixValues { get; set; } = new Dictionary(); - - public override void Process(TagHelperContext context, TagHelperOutput output) - { - } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InjectDirectiveTargetExtensionTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InjectDirectiveTargetExtensionTest.cs deleted file mode 100644 index e499363ef9..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InjectDirectiveTargetExtensionTest.cs +++ /dev/null @@ -1,75 +0,0 @@ -// 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.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.CodeGeneration; -using Microsoft.AspNetCore.Razor.Evolution.Legacy; -using Xunit; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class InjectDirectiveTargetExtensionTest - { - [Fact] - public void InjectDirectiveTargetExtension_WritesProperty() - { - // Arrange - var context = GetRenderingContext(); - var target = new InjectDirectiveTargetExtension(); - var node = new InjectDirectiveIRNode() - { - TypeName = "PropertyType", - MemberName = "PropertyName", - }; - - // Act - target.WriteInjectProperty(context, node); - - // Assert - Assert.Equal( - "[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]" + Environment.NewLine + - "public PropertyType PropertyName { get; private set; }" + Environment.NewLine, - context.Writer.Builder.ToString()); - } - - [Fact] - public void InjectDirectiveTargetExtension_WritesPropertyWithLinePragma_WhenSourceIsSet() - { - // Arrange - var context = GetRenderingContext(); - var target = new InjectDirectiveTargetExtension(); - var node = new InjectDirectiveIRNode() - { - TypeName = "PropertyType", - MemberName = "PropertyName", - Source = new SourceSpan( - filePath: "test-path", - absoluteIndex: 0, - lineIndex: 1, - characterIndex: 1, - length: 10) - }; - - // Act - target.WriteInjectProperty(context, node); - - // Assert - Assert.Equal( - "#line 2 \"test-path\"" + Environment.NewLine + - "[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]" + Environment.NewLine + - "public PropertyType PropertyName { get; private set; }" + Environment.NewLine + Environment.NewLine + - "#line default" + Environment.NewLine + - "#line hidden" + Environment.NewLine, - context.Writer.Builder.ToString()); - } - - private CSharpRenderingContext GetRenderingContext() - { - return new CSharpRenderingContext() - { - Writer = new CSharpCodeWriter() - }; - } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InjectDirectiveTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InjectDirectiveTest.cs deleted file mode 100644 index b66b2b26db..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InjectDirectiveTest.cs +++ /dev/null @@ -1,226 +0,0 @@ -// 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.IO; -using System.Text; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; -using Xunit; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class InjectDirectiveTest - { - [Fact] - public void InjectDirectivePass_Execute_DefinesProperty() - { - // Arrange - var codeDocument = CreateDocument(@" -@inject PropertyType PropertyName -"); - - var engine = CreateEngine(); - var pass = new InjectDirective.Pass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var @class = FindClassNode(irDocument); - Assert.NotNull(@class); - Assert.Equal(2, @class.Children.Count); - - var node = Assert.IsType(@class.Children[1]); - Assert.Equal("PropertyType", node.TypeName); - Assert.Equal("PropertyName", node.MemberName); - } - - [Fact] - public void InjectDirectivePass_Execute_DedupesPropertiesByName() - { - // Arrange - var codeDocument = CreateDocument(@" -@inject PropertyType PropertyName -@inject PropertyType2 PropertyName -"); - - var engine = CreateEngine(); - var pass = new InjectDirective.Pass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var @class = FindClassNode(irDocument); - Assert.NotNull(@class); - Assert.Equal(2, @class.Children.Count); - - var node = Assert.IsType(@class.Children[1]); - Assert.Equal("PropertyType2", node.TypeName); - Assert.Equal("PropertyName", node.MemberName); - } - - [Fact] - public void InjectDirectivePass_Execute_ExpandsTModel_WithDynamic() - { - // Arrange - var codeDocument = CreateDocument(@" -@inject PropertyType PropertyName -"); - - var engine = CreateEngine(); - var pass = new InjectDirective.Pass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var @class = FindClassNode(irDocument); - Assert.NotNull(@class); - Assert.Equal(2, @class.Children.Count); - - var node = Assert.IsType(@class.Children[1]); - Assert.Equal("PropertyType", node.TypeName); - Assert.Equal("PropertyName", node.MemberName); - } - - [Fact] - public void InjectDirectivePass_Execute_ExpandsTModel_WithModelTypeFirst() - { - // Arrange - var codeDocument = CreateDocument(@" -@model ModelType -@inject PropertyType PropertyName -"); - - var engine = CreateEngine(); - var pass = new InjectDirective.Pass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var @class = FindClassNode(irDocument); - Assert.NotNull(@class); - Assert.Equal(2, @class.Children.Count); - - var node = Assert.IsType(@class.Children[1]); - Assert.Equal("PropertyType", node.TypeName); - Assert.Equal("PropertyName", node.MemberName); - } - - [Fact] - public void InjectDirectivePass_Execute_ExpandsTModel_WithModelType() - { - // Arrange - var codeDocument = CreateDocument(@" -@inject PropertyType PropertyName -@model ModelType -"); - - var engine = CreateEngine(); - var pass = new InjectDirective.Pass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var @class = FindClassNode(irDocument); - Assert.NotNull(@class); - Assert.Equal(2, @class.Children.Count); - - var node = Assert.IsType(@class.Children[1]); - Assert.Equal("PropertyType", node.TypeName); - Assert.Equal("PropertyName", node.MemberName); - } - - private RazorCodeDocument CreateDocument(string content) - { - var source = RazorSourceDocument.Create(content, "test.cshtml"); - return RazorCodeDocument.Create(source); - } - - private ClassDeclarationIRNode FindClassNode(RazorIRNode node) - { - var visitor = new ClassNodeVisitor(); - visitor.Visit(node); - return visitor.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.AddDirective(InjectDirective.Directive); - b.AddDirective(ModelDirective.Directive); - }); - } - - 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(); - } - - private string GetCSharpContent(RazorIRNode node) - { - var builder = new StringBuilder(); - for (var i = 0; i < node.Children.Count; i++) - { - var child = node.Children[i] as RazorIRToken; - if (child.Kind == RazorIRToken.TokenKind.CSharp) - { - builder.Append(child.Content); - } - } - - return builder.ToString(); - } - - private class ClassNodeVisitor : RazorIRNodeWalker - { - public ClassDeclarationIRNode Node { get; set; } - - public override void VisitClass(ClassDeclarationIRNode node) - { - Node = node; - } - } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InputTestTagHelper.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InputTestTagHelper.cs deleted file mode 100644 index 4abfc8077c..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/InputTestTagHelper.cs +++ /dev/null @@ -1,13 +0,0 @@ -// 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.Mvc.ViewFeatures; -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace Microsoft.AspNetCore.Mvc.Razor -{ - public class InputTestTagHelper : TagHelper - { - public ModelExpression For { get; set; } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/LineMappingsSerializer.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/LineMappingsSerializer.cs deleted file mode 100644 index 776f301d5b..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/LineMappingsSerializer.cs +++ /dev/null @@ -1,54 +0,0 @@ -// 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 System.Text; -using Microsoft.AspNetCore.Razor.Evolution; - -namespace Microsoft.AspNetCore.Mvc.Razor -{ - public static class LineMappingsSerializer - { - public static string Serialize(RazorCSharpDocument csharpDocument, RazorSourceDocument sourceDocument) - { - var builder = new StringBuilder(); - var sourceFileName = sourceDocument.FileName; - var charBuffer = new char[sourceDocument.Length]; - sourceDocument.CopyTo(0, charBuffer, 0, sourceDocument.Length); - var sourceContent = new string(charBuffer); - - for (var i = 0; i < csharpDocument.LineMappings.Count; i++) - { - var lineMapping = csharpDocument.LineMappings[i]; - if (!string.Equals(lineMapping.OriginalSpan.FilePath, sourceFileName, StringComparison.Ordinal)) - { - continue; - } - - builder.Append("Source Location: "); - AppendMappingLocation(builder, lineMapping.OriginalSpan, sourceContent); - - builder.Append("Generated Location: "); - AppendMappingLocation(builder, lineMapping.GeneratedSpan, csharpDocument.GeneratedCode); - - builder.AppendLine(); - } - - return builder.ToString(); - } - - private static void AppendMappingLocation(StringBuilder builder, SourceSpan location, string content) - { - builder - .AppendLine(location.ToString()) - .Append("|"); - - for (var i = 0; i < location.Length; i++) - { - builder.Append(content[location.AbsoluteIndex + i]); - } - - builder.AppendLine("|"); - } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Microsoft.AspNetCore.Mvc.Razor.Host.Test.csproj b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Microsoft.AspNetCore.Mvc.Razor.Host.Test.csproj deleted file mode 100644 index a6f04de6ed..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Microsoft.AspNetCore.Mvc.Razor.Host.Test.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - netcoreapp2.0;net46 - netcoreapp2.0 - true - $(DefineConstants);GENERATE_BASELINES - $(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES - $(DefaultItemExcludes);TestFiles\** - true - true - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ModelDirectiveTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ModelDirectiveTest.cs deleted file mode 100644 index dc8a18c0ad..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ModelDirectiveTest.cs +++ /dev/null @@ -1,220 +0,0 @@ -// 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 System.IO; -using System.Text; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; -using Xunit; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class ModelDirectiveTest - { - [Fact] - public void ModelDirective_GetModelType_GetsTypeFromLastWellFormedDirective() - { - // Arrange - var codeDocument = CreateDocument(@" -@model Type1 -@model Type2 -@model -"); - - var engine = CreateEngine(); - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - var result = ModelDirective.GetModelType(irDocument); - - // Assert - Assert.Equal("Type2", result); - } - - [Fact] - public void ModelDirective_GetModelType_DefaultsToDynamic() - { - // Arrange - var codeDocument = CreateDocument(@" "); - - var engine = CreateEngine(); - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - var result = ModelDirective.GetModelType(irDocument); - - // Assert - Assert.Equal("dynamic", result); - } - - [Fact] - public void ModelDirectivePass_Execute_ReplacesTModelInBaseType() - { - // Arrange - var codeDocument = CreateDocument(@" -@inherits BaseType -@model Type1 -"); - - var engine = CreateEngine(); - var pass = new ModelDirective.Pass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var @class = FindClassNode(irDocument); - Assert.NotNull(@class); - Assert.Equal("BaseType", @class.BaseType); - } - - [Fact] - public void ModelDirectivePass_Execute_ReplacesTModelInBaseType_DifferentOrdering() - { - // Arrange - var codeDocument = CreateDocument(@" -@model Type1 -@inherits BaseType -@model Type2 -"); - - var engine = CreateEngine(); - var pass = new ModelDirective.Pass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var @class = FindClassNode(irDocument); - Assert.NotNull(@class); - Assert.Equal("BaseType", @class.BaseType); - } - - [Fact] - public void ModelDirectivePass_Execute_NoOpWithoutTModel() - { - // Arrange - var codeDocument = CreateDocument(@" -@inherits BaseType -@model Type1 -"); - - var engine = CreateEngine(); - var pass = new ModelDirective.Pass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var @class = FindClassNode(irDocument); - Assert.NotNull(@class); - Assert.Equal("BaseType", @class.BaseType); - } - - [Fact] - public void ModelDirectivePass_Execute_ReplacesTModelInBaseType_DefaultDynamic() - { - // Arrange - var codeDocument = CreateDocument(@" -@inherits BaseType -"); - - var engine = CreateEngine(); - var pass = new ModelDirective.Pass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var @class = FindClassNode(irDocument); - Assert.NotNull(@class); - Assert.Equal("BaseType", @class.BaseType); - } - - private RazorCodeDocument CreateDocument(string content) - { - var source = RazorSourceDocument.Create(content, "test.cshtml"); - return RazorCodeDocument.Create(source); - } - - private ClassDeclarationIRNode FindClassNode(RazorIRNode node) - { - var visitor = new ClassNodeVisitor(); - visitor.Visit(node); - return visitor.Node; - } - - private RazorEngine CreateEngine() - { - return RazorEngine.Create(b => - { - // Notice we're not registering the ModelDirective.Pass here so we can run it on demand. - b.AddDirective(ModelDirective.Directive); - }); - } - - 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(); - } - - private string GetCSharpContent(RazorIRNode node) - { - var builder = new StringBuilder(); - for (var i = 0; i < node.Children.Count; i++) - { - var child = node.Children[i] as RazorIRToken; - if (child.Kind == RazorIRToken.TokenKind.CSharp) - { - builder.Append(child.Content); - } - } - - return builder.ToString(); - } - - private class ClassNodeVisitor : RazorIRNodeWalker - { - public ClassDeclarationIRNode Node { get; set; } - - public override void VisitClass(ClassDeclarationIRNode node) - { - Node = node; - } - } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ModelExpressionPassTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ModelExpressionPassTest.cs deleted file mode 100644 index 3998336a34..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/ModelExpressionPassTest.cs +++ /dev/null @@ -1,236 +0,0 @@ -// 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.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Microsoft.AspNetCore.Mvc.ViewFeatures; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; -using Microsoft.AspNetCore.Razor.Evolution.Legacy; -using Xunit; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class ModelExpressionPassTest - { - [Fact] - public void ModelExpressionPass_NonModelExpressionProperty_Ignored() - { - // Arrange - var codeDocument = CreateDocument(@" -@addTagHelper TestTagHelper, TestAssembly -

"); - - var tagHelpers = new[] - { - ITagHelperDescriptorBuilder.Create("TestTagHelper", "TestAssembly") - .BindAttribute(attribute => - attribute - .Name("Foo") - .TypeName("System.Int32")) - .TagMatchingRule(rule => - rule.RequireTagName("p")) - .Build() - }; - - var engine = CreateEngine(tagHelpers); - var pass = new ModelExpressionPass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var tagHelper = FindTagHelperNode(irDocument); - var setProperty = tagHelper.Children.OfType().Single(); - - var child = Assert.IsType(Assert.Single(setProperty.Children)); - Assert.Equal("17", child.Content); - } - - [Fact] - public void ModelExpressionPass_ModelExpressionProperty_SimpleExpression() - { - // Arrange - - // Using \r\n here because we verify line mappings - var codeDocument = CreateDocument( - "@addTagHelper TestTagHelper, TestAssembly\r\n

"); - - var tagHelpers = new[] - { - ITagHelperDescriptorBuilder.Create("TestTagHelper", "TestAssembly") - .BindAttribute(attribute => - attribute - .Name("Foo") - .TypeName(typeof(ModelExpression).FullName)) - .TagMatchingRule(rule => - rule.RequireTagName("p")) - .Build() - }; - - var engine = CreateEngine(tagHelpers); - var pass = new ModelExpressionPass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var tagHelper = FindTagHelperNode(irDocument); - var setProperty = tagHelper.Children.OfType().Single(); - - var expression = Assert.IsType(Assert.Single(setProperty.Children)); - Assert.Equal("ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Bar)", GetCSharpContent(expression)); - - var originalNode = Assert.IsType(expression.Children[2]); - Assert.Equal(RazorIRToken.TokenKind.CSharp, originalNode.Kind); - Assert.Equal("Bar", originalNode.Content); - Assert.Equal(new SourceSpan("test.cshtml", 51, 1, 8, 3), originalNode.Source.Value); - } - - [Fact] - public void ModelExpressionPass_ModelExpressionProperty_ComplexExpression() - { - // Arrange - - // Using \r\n here because we verify line mappings - var codeDocument = CreateDocument( - "@addTagHelper TestTagHelper, TestAssembly\r\n

"); - - var tagHelpers = new[] - { - ITagHelperDescriptorBuilder.Create("TestTagHelper", "TestAssembly") - .BindAttribute(attribute => - attribute - .Name("Foo") - .TypeName(typeof(ModelExpression).FullName)) - .TagMatchingRule(rule => - rule.RequireTagName("p")) - .Build() - }; - - var engine = CreateEngine(tagHelpers); - var pass = new ModelExpressionPass() - { - Engine = engine, - }; - - var irDocument = CreateIRDocument(engine, codeDocument); - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - var tagHelper = FindTagHelperNode(irDocument); - var setProperty = tagHelper.Children.OfType().Single(); - - var expression = Assert.IsType(Assert.Single(setProperty.Children)); - Assert.Equal("ModelExpressionProvider.CreateModelExpression(ViewData, __model => Bar)", GetCSharpContent(expression)); - - var originalNode = Assert.IsType(expression.Children[1]); - Assert.Equal(RazorIRToken.TokenKind.CSharp, originalNode.Kind); - Assert.Equal("Bar", originalNode.Content); - Assert.Equal(new SourceSpan("test.cshtml", 52, 1, 9, 3), originalNode.Source.Value); - } - - private RazorCodeDocument CreateDocument(string content) - { - var source = RazorSourceDocument.Create(content, "test.cshtml"); - return RazorCodeDocument.Create(source); - } - - private RazorEngine CreateEngine(params TagHelperDescriptor[] tagHelpers) - { - return RazorEngine.Create(b => - { - b.Features.Add(new TagHelperFeature(tagHelpers)); - }); - } - - 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 IRazorDirectiveClassifierPhase) - { - break; - } - } - - return codeDocument.GetIRDocument(); - } - - private TagHelperIRNode FindTagHelperNode(RazorIRNode node) - { - var visitor = new TagHelperNodeVisitor(); - visitor.Visit(node); - return visitor.Node; - } - - private string GetCSharpContent(RazorIRNode node) - { - var builder = new StringBuilder(); - for (var i = 0; i < node.Children.Count; i++) - { - var child = node.Children[i] as RazorIRToken; - if (child.Kind == RazorIRToken.TokenKind.CSharp) - { - builder.Append(child.Content); - } - } - - return builder.ToString(); - } - - private class TagHelperNodeVisitor : RazorIRNodeWalker - { - public TagHelperIRNode Node { get; set; } - - public override void VisitTagHelper(TagHelperIRNode node) - { - Node = node; - } - } - - private class TagHelperFeature : ITagHelperFeature - { - public TagHelperFeature(TagHelperDescriptor[] tagHelpers) - { - Resolver = new TagHelperDescriptorResolver(tagHelpers); - } - - public RazorEngine Engine { get; set; } - - public ITagHelperDescriptorResolver Resolver { get; } - } - - private class TagHelperDescriptorResolver : ITagHelperDescriptorResolver - { - public TagHelperDescriptorResolver(TagHelperDescriptor[] tagHelpers) - { - TagHelpers = tagHelpers; - } - - public TagHelperDescriptor[] TagHelpers { get; } - - public IEnumerable Resolve(IList errors) - { - return TagHelpers; - } - } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/MvcRazorTemplateEngineTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/MvcRazorTemplateEngineTest.cs deleted file mode 100644 index 4bd5f3b78d..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/MvcRazorTemplateEngineTest.cs +++ /dev/null @@ -1,127 +0,0 @@ -// 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 System.Linq; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.Extensions.FileProviders; -using Moq; -using Xunit; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class MvcRazorTemplateEngineTest - { - [Fact] - public void GetDefaultImports_IncludesDefaultImports() - { - // Arrange - var expectedImports = new[] - { - "@using System", - "@using System.Linq", - "@using System.Collections.Generic", - "@using Microsoft.AspNetCore.Mvc", - "@using Microsoft.AspNetCore.Mvc.Rendering", - "@using Microsoft.AspNetCore.Mvc.ViewFeatures", - }; - var mvcRazorTemplateEngine = new MvcRazorTemplateEngine( - RazorEngine.Create(), - GetRazorProject(new TestFileProvider())); - - // Act - var imports = mvcRazorTemplateEngine.Options.DefaultImports; - - // Assert - var importContent = GetContent(imports) - .Split(new[] { Environment.NewLine }, StringSplitOptions.None) - .Where(line => line.StartsWith("@using")); - Assert.Equal(expectedImports, importContent); - } - - [Fact] - public void GetDefaultImports_IncludesDefaulInjects() - { - // Arrange - var expectedImports = new[] - { - "@inject global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html", - "@inject global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json", - "@inject global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component", - "@inject global::Microsoft.AspNetCore.Mvc.IUrlHelper Url", - "@inject global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider", - }; - var mvcRazorTemplateEngine = new MvcRazorTemplateEngine( - RazorEngine.Create(), - GetRazorProject(new TestFileProvider())); - - // Act - var imports = mvcRazorTemplateEngine.Options.DefaultImports; - - // Assert - var importContent = GetContent(imports) - .Split(new[] { Environment.NewLine }, StringSplitOptions.None) - .Where(line => line.StartsWith("@inject")); - Assert.Equal(expectedImports, importContent); - } - - [Fact] - public void GetDefaultImports_IncludesUrlTagHelper() - { - // Arrange - var mvcRazorTemplateEngine = new MvcRazorTemplateEngine( - RazorEngine.Create(), - GetRazorProject(new TestFileProvider())); - - // Act - var imports = mvcRazorTemplateEngine.Options.DefaultImports; - - // Assert - var importContent = GetContent(imports) - .Split(new[] { Environment.NewLine }, StringSplitOptions.None) - .Where(line => line.StartsWith("@addTagHelper")); - - Assert.Contains("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor", - importContent); - Assert.Contains("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor", - importContent); - Assert.Contains("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor", - importContent); - } - - [Fact] - public void CreateCodeDocument_SetsRelativePathOnOutput() - { - // Arrange - var path = "/Views/Home/Index.cshtml"; - var fileProvider = new TestFileProvider(); - fileProvider.AddFile(path, "Hello world"); - var mvcRazorTemplateEngine = new MvcRazorTemplateEngine( - RazorEngine.Create(), - GetRazorProject(fileProvider)); - - // Act - var codeDocument = mvcRazorTemplateEngine.CreateCodeDocument(path); - - // Assert - Assert.Equal(path, codeDocument.GetRelativePath()); - } - - private string GetContent(RazorSourceDocument imports) - { - var contentChars = new char[imports.Length]; - imports.CopyTo(0, contentChars, 0, imports.Length); - return new string(contentChars); - } - - private static DefaultRazorProject GetRazorProject(IFileProvider fileProvider) - { - var fileProviderAccessor = new Mock(); - fileProviderAccessor.SetupGet(f => f.FileProvider) - .Returns(fileProvider); - - return new DefaultRazorProject(fileProviderAccessor.Object); - } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/MvcViewDocumentClassifierPassTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/MvcViewDocumentClassifierPassTest.cs deleted file mode 100644 index 2fe80e60c4..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/MvcViewDocumentClassifierPassTest.cs +++ /dev/null @@ -1,246 +0,0 @@ -// 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.IO; -using System.Linq; -using System.Text; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; -using Xunit; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class MvcViewDocumentClassifierPassTest - { - [Fact] - public void MvcViewDocumentClassifierPass_SetsDocumentKind() - { - // Arrange - var codeDocument = CreateDocument("some-content"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new MvcViewDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - Assert.Equal("mvc.1.0.view", irDocument.DocumentKind); - } - - [Fact] - public void MvcViewDocumentClassifierPass_NoOpsIfDocumentKindIsAlreadySet() - { - // Arrange - var codeDocument = CreateDocument("some-content"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - irDocument.DocumentKind = "some-value"; - var pass = new MvcViewDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - Assert.Equal("some-value", irDocument.DocumentKind); - } - - [Fact] - public void MvcViewDocumentClassifierPass_SetsNamespace() - { - // Arrange - var codeDocument = CreateDocument("some-content"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new MvcViewDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal("AspNetCore", visitor.Namespace.Content); - } - - [Fact] - public void MvcViewDocumentClassifierPass_SetsClass() - { - // Arrange - var codeDocument = CreateDocument("some-content"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new MvcViewDocumentClassifierPass - { - Engine = engine - }; - codeDocument.SetRelativePath("Test.cshtml"); - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal("global::Microsoft.AspNetCore.Mvc.Razor.RazorPage", visitor.Class.BaseType); - Assert.Equal("public", visitor.Class.AccessModifier); - Assert.Equal("Test_cshtml", visitor.Class.Name); - } - - [Theory] - [InlineData("/Views/Home/Index.cshtml", "_Views_Home_Index_cshtml")] - [InlineData("/Areas/MyArea/Views/Home/About.cshtml", "_Areas_MyArea_Views_Home_About_cshtml")] - public void MvcViewDocumentClassifierPass_UsesRelativePathToGenerateTypeName(string relativePath, string expected) - { - // Arrange - var codeDocument = CreateDocument("some-content"); - codeDocument.SetRelativePath(relativePath); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new MvcViewDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal(expected, visitor.Class.Name); - } - - [Fact] - public void MvcViewDocumentClassifierPass_UsesAbsolutePath_IfRelativePathIsNotSet() - { - // Arrange - var expected = "x___application_Views_Home_Index_cshtml"; - var path = @"x::\application\Views\Home\Index.cshtml"; - var codeDocument = CreateDocument("some-content", path); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new MvcViewDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal(expected, visitor.Class.Name); - } - - [Fact] - public void MvcViewDocumentClassifierPass_SanitizesClassName() - { - // Arrange - var expected = "path_with_invalid_chars"; - var codeDocument = CreateDocument("some-content"); - codeDocument.SetRelativePath("path.with+invalid-chars"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new MvcViewDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal(expected, visitor.Class.Name); - } - - [Fact] - public void MvcViewDocumentClassifierPass_SetsUpExecuteAsyncMethod() - { - // Arrange - var codeDocument = CreateDocument("some-content"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new MvcViewDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal("ExecuteAsync", visitor.Method.Name); - Assert.Equal("public", visitor.Method.AccessModifier); - Assert.Equal("global::System.Threading.Tasks.Task", visitor.Method.ReturnType); - Assert.Equal(new[] { "async", "override" }, visitor.Method.Modifiers); - } - - private static RazorCodeDocument CreateDocument(string content, string filePath = null) - { - filePath = filePath ?? Path.Combine(Directory.GetCurrentDirectory(), "Test.cshtml"); - - var source = RazorSourceDocument.Create(content, filePath); - return RazorCodeDocument.Create(source); - } - - private static RazorEngine CreateEngine() => RazorEngine.Create(); - - private static 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 IRazorIRLoweringPhase) - { - break; - } - } - - return codeDocument.GetIRDocument(); - } - - private class Visitor : RazorIRNodeWalker - { - public NamespaceDeclarationIRNode Namespace { get; private set; } - - public ClassDeclarationIRNode Class { get; private set; } - - public RazorMethodDeclarationIRNode Method { get; private set; } - - public override void VisitRazorMethodDeclaration(RazorMethodDeclarationIRNode node) - { - Method = node; - } - - public override void VisitNamespace(NamespaceDeclarationIRNode node) - { - Namespace = node; - base.VisitNamespace(node); - } - - public override void VisitClass(ClassDeclarationIRNode node) - { - Class = node; - base.VisitClass(node); - } - } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Properties/AssemblyInfo.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index 3337ebeac2..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/RazorEngineTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/RazorEngineTest.cs deleted file mode 100644 index 61791eb139..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/RazorEngineTest.cs +++ /dev/null @@ -1,238 +0,0 @@ -// 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.Linq; -using System.Reflection; -using Microsoft.AspNetCore.Mvc.Razor.Host; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Razor; -using Microsoft.Extensions.DependencyModel; -using Microsoft.Extensions.FileProviders; -using Moq; -using Xunit; - -namespace Microsoft.AspNetCore.Mvc.Razor -{ - public class RazorEngineTest - { - private static Assembly _assembly = typeof(RazorEngineTest).GetTypeInfo().Assembly; - - #region Runtime - [Fact] - public void RazorEngine_Basic_Runtime() - { - RunRuntimeTest("Basic"); - } - - [Fact] - public void RazorEngine_ViewImports_Runtime() - { - RunRuntimeTest("_ViewImports"); - } - - [Fact] - public void RazorEngine_Inject_Runtime() - { - RunRuntimeTest("Inject"); - } - - [Fact] - public void RazorEngine_InjectWithModel_Runtime() - { - RunRuntimeTest("InjectWithModel"); - } - - [Fact] - public void RazorEngine_InjectWithSemicolon_Runtime() - { - RunRuntimeTest("InjectWithSemicolon"); - } - - [Fact] - public void RazorEngine_Model_Runtime() - { - RunRuntimeTest("Model"); - } - - [Fact] - public void RazorEngine_ModelExpressionTagHelper_Runtime() - { - RunRuntimeTest("ModelExpressionTagHelper"); - } - #endregion - - #region DesignTime - [Fact] - public void RazorEngine_Basic_DesignTime() - { - RunDesignTimeTest("Basic"); - } - - [Fact] - public void RazorEngine_ViewImports_DesignTime() - { - RunDesignTimeTest("_ViewImports"); - } - - [Fact] - public void RazorEngine_Inject_DesignTime() - { - RunDesignTimeTest("Inject"); - } - - [Fact] - public void RazorEngine_InjectWithModel_DesignTime() - { - RunDesignTimeTest("InjectWithModel"); - } - - [Fact] - public void RazorEngine_InjectWithSemicolon_DesignTime() - { - RunDesignTimeTest("InjectWithSemicolon"); - } - - [Fact] - public void RazorEngine_Model_DesignTime() - { - RunDesignTimeTest("Model"); - } - - [Fact] - public void RazorEngine_MultipleModels_DesignTime() - { - RunDesignTimeTest("MultipleModels"); - } - - [Fact] - public void RazorEngine_ModelExpressionTagHelper_DesignTime() - { - RunDesignTimeTest("ModelExpressionTagHelper"); - } - #endregion - - private static void RunRuntimeTest(string testName) - { - // Arrange - var inputFile = "TestFiles/Input/" + testName + ".cshtml"; - var outputFile = "TestFiles/Output/Runtime/" + testName + ".cs"; - var expectedCode = ResourceFile.ReadResource(_assembly, outputFile, sourceFile: false); - - var engine = RazorEngine.Create(b => - { - InjectDirective.Register(b); - ModelDirective.Register(b); - - b.AddTargetExtension(new InjectDirectiveTargetExtension()); - - b.Features.Add(new ModelExpressionPass()); - b.Features.Add(new MvcViewDocumentClassifierPass()); - b.Features.Add(new DefaultInstrumentationPass()); - - b.Features.Add(new DefaultTagHelperFeature()); - b.Features.Add(GetMetadataReferenceFeature()); - }); - - var inputContent = ResourceFile.ReadResource(_assembly, inputFile, sourceFile: true); - var fileProvider = new TestFileProvider(); - fileProvider.AddFile(inputFile, inputContent); - var fileInfo = fileProvider.GetFileInfo(inputFile); - var razorTemplateEngine = new MvcRazorTemplateEngine(engine, GetRazorProject(fileProvider)); - var razorProjectItem = new DefaultRazorProjectItem(fileInfo, basePath: null, path: inputFile); - var codeDocument = razorTemplateEngine.CreateCodeDocument(razorProjectItem); - codeDocument.Items["SuppressUniqueIds"] = "test"; - codeDocument.Items["NewLineString"] = "\r\n"; - - // Act - var csharpDocument = razorTemplateEngine.GenerateCode(codeDocument); - - // Assert - Assert.Empty(csharpDocument.Diagnostics); - -#if GENERATE_BASELINES - ResourceFile.UpdateFile(_assembly, outputFile, expectedCode, csharpDocument.GeneratedCode); -#else - Assert.Equal(expectedCode, csharpDocument.GeneratedCode, ignoreLineEndingDifferences: true); -#endif - } - - private static void RunDesignTimeTest(string testName) - { - // Arrange - var inputFile = "TestFiles/Input/" + testName + ".cshtml"; - var outputFile = "TestFiles/Output/DesignTime/" + testName + ".cs"; - var expectedCode = ResourceFile.ReadResource(_assembly, outputFile, sourceFile: false); - - var lineMappingOutputFile = "TestFiles/Output/DesignTime/" + testName + ".mappings.txt"; - var expectedMappings = ResourceFile.ReadResource(_assembly, lineMappingOutputFile, sourceFile: false); - - var engine = RazorEngine.CreateDesignTime(b => - { - InjectDirective.Register(b); - ModelDirective.Register(b); - - b.AddTargetExtension(new InjectDirectiveTargetExtension()); - - b.Features.Add(new ModelExpressionPass()); - b.Features.Add(new MvcViewDocumentClassifierPass()); - - b.Features.Add(new DefaultTagHelperFeature()); - b.Features.Add(GetMetadataReferenceFeature()); - }); - - var inputContent = ResourceFile.ReadResource(_assembly, inputFile, sourceFile: true); - var fileProvider = new TestFileProvider(); - fileProvider.AddFile(inputFile, inputContent); - var fileInfo = fileProvider.GetFileInfo(inputFile); - var razorTemplateEngine = new MvcRazorTemplateEngine(engine, GetRazorProject(fileProvider)); - var razorProjectItem = new DefaultRazorProjectItem(fileInfo, basePath: null, path: inputFile); - var codeDocument = razorTemplateEngine.CreateCodeDocument(razorProjectItem); - codeDocument.Items["SuppressUniqueIds"] = "test"; - codeDocument.Items["NewLineString"] = "\r\n"; - - // Act - var csharpDocument = razorTemplateEngine.GenerateCode(codeDocument); - - // Assert - Assert.Empty(csharpDocument.Diagnostics); - - var serializedMappings = LineMappingsSerializer.Serialize(csharpDocument, codeDocument.Source); - -#if GENERATE_BASELINES - ResourceFile.UpdateFile(_assembly, outputFile, expectedCode, csharpDocument.GeneratedCode); - ResourceFile.UpdateFile(_assembly, lineMappingOutputFile, expectedMappings, serializedMappings); -#else - Assert.Equal(expectedCode, csharpDocument.GeneratedCode, ignoreLineEndingDifferences: true); - Assert.Equal(expectedMappings, serializedMappings, ignoreLineEndingDifferences: true); -#endif - } - - private static IRazorEngineFeature GetMetadataReferenceFeature() - { - var currentAssembly = typeof(RazorEngineTest).GetTypeInfo().Assembly; - var dependencyContext = DependencyContext.Load(currentAssembly); - - var references = dependencyContext.CompileLibraries.SelectMany(l => l.ResolveReferencePaths()) - .Select(assemblyPath => MetadataReference.CreateFromFile(assemblyPath)) - .ToList(); - - var feature = new DefaultMetadataReferenceFeature() - { - References = references, - }; - - return feature; - } - - private static DefaultRazorProject GetRazorProject(IFileProvider fileProvider) - { - var fileProviderAccessor = new Mock(); - fileProviderAccessor.SetupGet(f => f.FileProvider) - .Returns(fileProvider); - - return new DefaultRazorProject(fileProviderAccessor.Object); - } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/RazorPageDocumentClassifierPassTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/RazorPageDocumentClassifierPassTest.cs deleted file mode 100644 index 66fcd8b6a3..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/RazorPageDocumentClassifierPassTest.cs +++ /dev/null @@ -1,272 +0,0 @@ -// 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.IO; -using System.Linq; -using System.Text; -using Microsoft.AspNetCore.Mvc.Razor.Internal; -using Microsoft.AspNetCore.Razor.Evolution; -using Microsoft.AspNetCore.Razor.Evolution.Intermediate; -using Xunit; - -namespace Microsoft.AspNetCore.Mvc.Razor.Host -{ - public class RazorPageDocumentClassifierPassTest - { - [Fact] - public void RazorPageDocumentClassifierPass_SetsDocumentKind() - { - // Arrange - var codeDocument = CreateDocument("@page"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new RazorPageDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - Assert.Equal("mvc.1.0.razor-page", irDocument.DocumentKind); - } - - [Fact] - public void RazorPageDocumentClassifierPass_NoOpsIfDocumentKindIsAlreadySet() - { - // Arrange - var codeDocument = CreateDocument("@page"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - irDocument.DocumentKind = "some-value"; - var pass = new RazorPageDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - Assert.Equal("some-value", irDocument.DocumentKind); - } - - [Fact] - public void RazorPageDocumentClassifierPass_NoOpsIfPageDirectiveIsMalformed() - { - // Arrange - var codeDocument = CreateDocument("@page+1"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - irDocument.DocumentKind = "some-value"; - var pass = new RazorPageDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - - // Assert - Assert.Equal("some-value", irDocument.DocumentKind); - } - - [Fact] - public void RazorPageDocumentClassifierPass_SetsNamespace() - { - // Arrange - var codeDocument = CreateDocument("@page"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new RazorPageDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal("AspNetCore", visitor.Namespace.Content); - } - - [Fact] - public void RazorPageDocumentClassifierPass_SetsClass() - { - // Arrange - var codeDocument = CreateDocument("@page"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new RazorPageDocumentClassifierPass - { - Engine = engine - }; - codeDocument.SetRelativePath("Test.cshtml"); - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal("global::Microsoft.AspNetCore.Mvc.RazorPages.Page", visitor.Class.BaseType); - Assert.Equal("public", visitor.Class.AccessModifier); - Assert.Equal("Test_cshtml", visitor.Class.Name); - } - - [Theory] - [InlineData("/Views/Home/Index.cshtml", "_Views_Home_Index_cshtml")] - [InlineData("/Areas/MyArea/Views/Home/About.cshtml", "_Areas_MyArea_Views_Home_About_cshtml")] - public void RazorPageDocumentClassifierPass_UsesRelativePathToGenerateTypeName(string relativePath, string expected) - { - // Arrange - var codeDocument = CreateDocument("@page"); - codeDocument.SetRelativePath(relativePath); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new RazorPageDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal(expected, visitor.Class.Name); - } - - [Fact] - public void RazorPageDocumentClassifierPass_UsesAbsolutePath_IfRelativePathIsNotSet() - { - // Arrange - var expected = "x___application_Views_Home_Index_cshtml"; - var path = @"x::\application\Views\Home\Index.cshtml"; - var codeDocument = CreateDocument("@page", path); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new RazorPageDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal(expected, visitor.Class.Name); - } - - [Fact] - public void RazorPageDocumentClassifierPass_SanitizesClassName() - { - // Arrange - var expected = "path_with_invalid_chars"; - var codeDocument = CreateDocument("@page"); - codeDocument.SetRelativePath("path.with+invalid-chars"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new RazorPageDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal(expected, visitor.Class.Name); - } - - [Fact] - public void RazorPageDocumentClassifierPass_SetsUpExecuteAsyncMethod() - { - // Arrange - var codeDocument = CreateDocument("@page"); - var engine = CreateEngine(); - var irDocument = CreateIRDocument(engine, codeDocument); - var pass = new RazorPageDocumentClassifierPass - { - Engine = engine - }; - - // Act - pass.Execute(codeDocument, irDocument); - var visitor = new Visitor(); - visitor.Visit(irDocument); - - // Assert - Assert.Equal("ExecuteAsync", visitor.Method.Name); - Assert.Equal("public", visitor.Method.AccessModifier); - Assert.Equal("global::System.Threading.Tasks.Task", visitor.Method.ReturnType); - Assert.Equal(new[] { "async", "override" }, visitor.Method.Modifiers); - } - - private static RazorCodeDocument CreateDocument(string content, string filePath = null) - { - filePath = filePath ?? Path.Combine(Directory.GetCurrentDirectory(), "Test.cshtml"); - - var source = RazorSourceDocument.Create(content, filePath); - return RazorCodeDocument.Create(source); - } - - private static RazorEngine CreateEngine() - { - return RazorEngine.Create(b => - { - PageDirective.Register(b); - }); - } - - private static 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 IRazorIRLoweringPhase) - { - break; - } - } - - return codeDocument.GetIRDocument(); - } - - private class Visitor : RazorIRNodeWalker - { - public NamespaceDeclarationIRNode Namespace { get; private set; } - - public ClassDeclarationIRNode Class { get; private set; } - - public RazorMethodDeclarationIRNode Method { get; private set; } - - public override void VisitRazorMethodDeclaration(RazorMethodDeclarationIRNode node) - { - Method = node; - } - - public override void VisitNamespace(NamespaceDeclarationIRNode node) - { - Namespace = node; - base.VisitNamespace(node); - } - - public override void VisitClass(ClassDeclarationIRNode node) - { - Class = node; - base.VisitClass(node); - } - } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Basic.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Basic.cshtml deleted file mode 100644 index 90b91c5da6..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Basic.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -

\ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Inject.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Inject.cshtml deleted file mode 100644 index 4e90b36808..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Inject.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using MyNamespace -@inject MyApp MyPropertyName \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/InjectWithModel.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/InjectWithModel.cshtml deleted file mode 100644 index b4d4a5589a..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/InjectWithModel.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@model MyModel -@inject MyApp MyPropertyName -@inject MyService Html \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/InjectWithSemicolon.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/InjectWithSemicolon.cshtml deleted file mode 100644 index d840486787..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/InjectWithSemicolon.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@model MyModel -@inject MyApp MyPropertyName; -@inject MyService Html; -@inject MyApp MyPropertyName2 ; -@inject MyService Html2 ; \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Model.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Model.cshtml deleted file mode 100644 index 4b73b2dc53..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/Model.cshtml +++ /dev/null @@ -1 +0,0 @@ -@model System.Collections.IEnumerable diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/ModelExpressionTagHelper.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/ModelExpressionTagHelper.cshtml deleted file mode 100644 index e0505d4001..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/ModelExpressionTagHelper.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@model DateTime - -@addTagHelper Microsoft.AspNetCore.Mvc.Razor.InputTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Host.Test -@addTagHelper Microsoft.AspNetCore.Mvc.Razor.DictionaryPrefixTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Host.Test - - - - -
- \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/MultipleModels.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/MultipleModels.cshtml deleted file mode 100644 index 350f93b776..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/MultipleModels.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@model ThisShouldBeGenerated -@model System.Collections.IEnumerable diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/_ViewImports.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/_ViewImports.cshtml deleted file mode 100644 index fea9533d09..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Input/_ViewImports.cshtml +++ /dev/null @@ -1 +0,0 @@ -@inject IHtmlHelper Model \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs deleted file mode 100644 index 31f86135f8..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace AspNetCore -{ - #line hidden - using System; - using System.Threading.Tasks; -#line 2 "" -using System.Linq; - -#line default -#line hidden -#line 3 "" -using System.Collections.Generic; - -#line default -#line hidden -#line 4 "" -using Microsoft.AspNetCore.Mvc; - -#line default -#line hidden -#line 5 "" -using Microsoft.AspNetCore.Mvc.Rendering; - -#line default -#line hidden -#line 6 "" -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -#line default -#line hidden - public class TestFiles_Input_Basic_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - { - #pragma warning disable 219 - private void __RazorDirectiveTokenHelpers__() { - } - #pragma warning restore 219 - private static System.Object __o = null; - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { -#line 1 "TestFiles/Input/Basic.cshtml" - __o = logo; - -#line default -#line hidden -#line 3 "TestFiles/Input/Basic.cshtml" -__o = Html.Input("SomeKey"); - -#line default -#line hidden - } - #pragma warning restore 1998 - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.mappings.txt deleted file mode 100644 index f2c7597e01..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.mappings.txt +++ /dev/null @@ -1,10 +0,0 @@ -Source Location: (13:0,13 [4] TestFiles/Input/Basic.cshtml) -|logo| -Generated Location: (979:41,13 [4] ) -|logo| - -Source Location: (43:2,5 [21] TestFiles/Input/Basic.cshtml) -|Html.Input("SomeKey")| -Generated Location: (1063:46,6 [21] ) -|Html.Input("SomeKey")| - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs deleted file mode 100644 index f771f95ba2..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs +++ /dev/null @@ -1,69 +0,0 @@ -namespace AspNetCore -{ - #line hidden - using System; - using System.Threading.Tasks; -#line 2 "" -using System.Linq; - -#line default -#line hidden -#line 3 "" -using System.Collections.Generic; - -#line default -#line hidden -#line 4 "" -using Microsoft.AspNetCore.Mvc; - -#line default -#line hidden -#line 5 "" -using Microsoft.AspNetCore.Mvc.Rendering; - -#line default -#line hidden -#line 6 "" -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -#line default -#line hidden -#line 1 "TestFiles/Input/Inject.cshtml" -using MyNamespace; - -#line default -#line hidden - public class TestFiles_Input_Inject_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - { - #pragma warning disable 219 - private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -MyApp __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object MyPropertyName = null; - } - ))(); - } - #pragma warning restore 219 - private static System.Object __o = null; - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - } - #pragma warning restore 1998 - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public MyApp MyPropertyName { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.mappings.txt deleted file mode 100644 index 100e65d173..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.mappings.txt +++ /dev/null @@ -1,10 +0,0 @@ -Source Location: (28:1,8 [5] TestFiles/Input/Inject.cshtml) -|MyApp| -Generated Location: (824:40,0 [5] ) -|MyApp| - -Source Location: (34:1,14 [14] TestFiles/Input/Inject.cshtml) -|MyPropertyName| -Generated Location: (926:44,14 [14] ) -|MyPropertyName| - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs deleted file mode 100644 index 588bf18452..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace AspNetCore -{ - #line hidden - using System; - using System.Threading.Tasks; -#line 2 "" -using System.Linq; - -#line default -#line hidden -#line 3 "" -using System.Collections.Generic; - -#line default -#line hidden -#line 4 "" -using Microsoft.AspNetCore.Mvc; - -#line default -#line hidden -#line 5 "" -using Microsoft.AspNetCore.Mvc.Rendering; - -#line default -#line hidden -#line 6 "" -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -#line default -#line hidden - public class TestFiles_Input_InjectWithModel_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - { - #pragma warning disable 219 - private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -MyModel __typeHelper = null; - } - ))(); - ((System.Action)(() => { -MyApp __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object MyPropertyName = null; - } - ))(); - ((System.Action)(() => { -MyService __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - } - #pragma warning restore 219 - private static System.Object __o = null; - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - } - #pragma warning restore 1998 - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public MyService Html { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public MyApp MyPropertyName { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.mappings.txt deleted file mode 100644 index 4a880f71c2..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.mappings.txt +++ /dev/null @@ -1,25 +0,0 @@ -Source Location: (7:0,7 [7] TestFiles/Input/InjectWithModel.cshtml) -|MyModel| -Generated Location: (741:35,0 [7] ) -|MyModel| - -Source Location: (24:1,8 [5] TestFiles/Input/InjectWithModel.cshtml) -|MyApp| -Generated Location: (831:39,0 [5] ) -|MyApp| - -Source Location: (30:1,14 [14] TestFiles/Input/InjectWithModel.cshtml) -|MyPropertyName| -Generated Location: (933:43,14 [14] ) -|MyPropertyName| - -Source Location: (54:2,8 [17] TestFiles/Input/InjectWithModel.cshtml) -|MyService| -Generated Location: (1017:47,0 [17] ) -|MyService| - -Source Location: (72:2,26 [4] TestFiles/Input/InjectWithModel.cshtml) -|Html| -Generated Location: (1131:51,14 [4] ) -|Html| - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs deleted file mode 100644 index 93834779ca..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs +++ /dev/null @@ -1,96 +0,0 @@ -namespace AspNetCore -{ - #line hidden - using System; - using System.Threading.Tasks; -#line 2 "" -using System.Linq; - -#line default -#line hidden -#line 3 "" -using System.Collections.Generic; - -#line default -#line hidden -#line 4 "" -using Microsoft.AspNetCore.Mvc; - -#line default -#line hidden -#line 5 "" -using Microsoft.AspNetCore.Mvc.Rendering; - -#line default -#line hidden -#line 6 "" -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -#line default -#line hidden - public class TestFiles_Input_InjectWithSemicolon_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - { - #pragma warning disable 219 - private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -MyModel __typeHelper = null; - } - ))(); - ((System.Action)(() => { -MyApp __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object MyPropertyName = null; - } - ))(); - ((System.Action)(() => { -MyService __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - ((System.Action)(() => { -MyApp __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object MyPropertyName2 = null; - } - ))(); - ((System.Action)(() => { -MyService __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html2 = null; - } - ))(); - } - #pragma warning restore 219 - private static System.Object __o = null; - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - } - #pragma warning restore 1998 - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public MyService Html2 { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public MyApp MyPropertyName2 { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public MyService Html { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public MyApp MyPropertyName { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.mappings.txt deleted file mode 100644 index 2030a05f31..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.mappings.txt +++ /dev/null @@ -1,45 +0,0 @@ -Source Location: (7:0,7 [7] TestFiles/Input/InjectWithSemicolon.cshtml) -|MyModel| -Generated Location: (745:35,0 [7] ) -|MyModel| - -Source Location: (24:1,8 [5] TestFiles/Input/InjectWithSemicolon.cshtml) -|MyApp| -Generated Location: (835:39,0 [5] ) -|MyApp| - -Source Location: (30:1,14 [14] TestFiles/Input/InjectWithSemicolon.cshtml) -|MyPropertyName| -Generated Location: (937:43,14 [14] ) -|MyPropertyName| - -Source Location: (58:2,8 [17] TestFiles/Input/InjectWithSemicolon.cshtml) -|MyService| -Generated Location: (1021:47,0 [17] ) -|MyService| - -Source Location: (76:2,26 [4] TestFiles/Input/InjectWithSemicolon.cshtml) -|Html| -Generated Location: (1135:51,14 [4] ) -|Html| - -Source Location: (93:3,8 [5] TestFiles/Input/InjectWithSemicolon.cshtml) -|MyApp| -Generated Location: (1209:55,0 [5] ) -|MyApp| - -Source Location: (99:3,14 [15] TestFiles/Input/InjectWithSemicolon.cshtml) -|MyPropertyName2| -Generated Location: (1311:59,14 [15] ) -|MyPropertyName2| - -Source Location: (129:4,8 [17] TestFiles/Input/InjectWithSemicolon.cshtml) -|MyService| -Generated Location: (1396:63,0 [17] ) -|MyService| - -Source Location: (147:4,26 [5] TestFiles/Input/InjectWithSemicolon.cshtml) -|Html2| -Generated Location: (1510:67,14 [5] ) -|Html2| - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs deleted file mode 100644 index 435a45f7b5..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs +++ /dev/null @@ -1,58 +0,0 @@ -namespace AspNetCore -{ - #line hidden - using System; - using System.Threading.Tasks; -#line 2 "" -using System.Linq; - -#line default -#line hidden -#line 3 "" -using System.Collections.Generic; - -#line default -#line hidden -#line 4 "" -using Microsoft.AspNetCore.Mvc; - -#line default -#line hidden -#line 5 "" -using Microsoft.AspNetCore.Mvc.Rendering; - -#line default -#line hidden -#line 6 "" -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -#line default -#line hidden - public class TestFiles_Input_Model_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - { - #pragma warning disable 219 - private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -System.Collections.IEnumerable __typeHelper = null; - } - ))(); - } - #pragma warning restore 219 - private static System.Object __o = null; - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - } - #pragma warning restore 1998 - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.mappings.txt deleted file mode 100644 index d8293c7986..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.mappings.txt +++ /dev/null @@ -1,5 +0,0 @@ -Source Location: (7:0,7 [30] TestFiles/Input/Model.cshtml) -|System.Collections.IEnumerable| -Generated Location: (754:35,0 [30] ) -|System.Collections.IEnumerable| - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs deleted file mode 100644 index 36e089e011..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs +++ /dev/null @@ -1,97 +0,0 @@ -namespace AspNetCore -{ - #line hidden - using System; - using System.Threading.Tasks; -#line 2 "" -using System.Linq; - -#line default -#line hidden -#line 3 "" -using System.Collections.Generic; - -#line default -#line hidden -#line 4 "" -using Microsoft.AspNetCore.Mvc; - -#line default -#line hidden -#line 5 "" -using Microsoft.AspNetCore.Mvc.Rendering; - -#line default -#line hidden -#line 6 "" -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -#line default -#line hidden - public class TestFiles_Input_ModelExpressionTagHelper_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - { - #pragma warning disable 219 - private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -DateTime __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.InputTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Host.Test"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.DictionaryPrefixTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Host.Test"; - } - ))(); - } - #pragma warning restore 219 - private static System.Object __o = null; - private global::Microsoft.AspNetCore.Mvc.Razor.InputTestTagHelper __Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper = null; - private global::Microsoft.AspNetCore.Mvc.Razor.DictionaryPrefixTestTagHelper __Microsoft_AspNetCore_Mvc_Razor_DictionaryPrefixTestTagHelper = null; - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - __Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper = CreateTagHelper(); -#line 6 "TestFiles/Input/ModelExpressionTagHelper.cshtml" -__Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Now); - -#line default -#line hidden - __Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper = CreateTagHelper(); -#line 7 "TestFiles/Input/ModelExpressionTagHelper.cshtml" -__Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => Model); - -#line default -#line hidden - __Microsoft_AspNetCore_Mvc_Razor_DictionaryPrefixTestTagHelper = CreateTagHelper(); -#line 9 "TestFiles/Input/ModelExpressionTagHelper.cshtml" -__Microsoft_AspNetCore_Mvc_Razor_DictionaryPrefixTestTagHelper.PrefixValues["test"] = ModelExpressionProvider.CreateModelExpression(ViewData, __model => Model); - -#line default -#line hidden - __Microsoft_AspNetCore_Mvc_Razor_DictionaryPrefixTestTagHelper = CreateTagHelper(); -#line 10 "TestFiles/Input/ModelExpressionTagHelper.cshtml" -__Microsoft_AspNetCore_Mvc_Razor_DictionaryPrefixTestTagHelper.PrefixValues["hour"] = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Hour); - -#line default -#line hidden -#line 10 "TestFiles/Input/ModelExpressionTagHelper.cshtml" -__Microsoft_AspNetCore_Mvc_Razor_DictionaryPrefixTestTagHelper.PrefixValues["minute"] = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Minute); - -#line default -#line hidden - } - #pragma warning restore 1998 - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.mappings.txt deleted file mode 100644 index 4d0526f06f..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.mappings.txt +++ /dev/null @@ -1,40 +0,0 @@ -Source Location: (7:0,7 [8] TestFiles/Input/ModelExpressionTagHelper.cshtml) -|DateTime| -Generated Location: (751:35,0 [8] ) -|DateTime| - -Source Location: (33:2,14 [91] TestFiles/Input/ModelExpressionTagHelper.cshtml) -|Microsoft.AspNetCore.Mvc.Razor.InputTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Host.Test| -Generated Location: (872:39,30 [91] ) -|Microsoft.AspNetCore.Mvc.Razor.InputTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Host.Test| - -Source Location: (140:3,14 [102] TestFiles/Input/ModelExpressionTagHelper.cshtml) -|Microsoft.AspNetCore.Mvc.Razor.DictionaryPrefixTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Host.Test| -Generated Location: (1057:43,30 [102] ) -|Microsoft.AspNetCore.Mvc.Razor.DictionaryPrefixTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Host.Test| - -Source Location: (263:5,17 [3] TestFiles/Input/ModelExpressionTagHelper.cshtml) -|Now| -Generated Location: (2047:56,133 [3] ) -|Now| - -Source Location: (290:6,18 [5] TestFiles/Input/ModelExpressionTagHelper.cshtml) -|Model| -Generated Location: (2414:62,125 [5] ) -|Model| - -Source Location: (322:8,19 [5] TestFiles/Input/ModelExpressionTagHelper.cshtml) -|Model| -Generated Location: (2833:68,153 [5] ) -|Model| - -Source Location: (357:9,19 [4] TestFiles/Input/ModelExpressionTagHelper.cshtml) -|Hour| -Generated Location: (3261:74,161 [4] ) -|Hour| - -Source Location: (378:9,40 [6] TestFiles/Input/ModelExpressionTagHelper.cshtml) -|Minute| -Generated Location: (3523:79,163 [6] ) -|Minute| - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/MultipleModels.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/MultipleModels.cs deleted file mode 100644 index baaeb0842e..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/MultipleModels.cs +++ /dev/null @@ -1,62 +0,0 @@ -namespace AspNetCore -{ - #line hidden - using System; - using System.Threading.Tasks; -#line 2 "" -using System.Linq; - -#line default -#line hidden -#line 3 "" -using System.Collections.Generic; - -#line default -#line hidden -#line 4 "" -using Microsoft.AspNetCore.Mvc; - -#line default -#line hidden -#line 5 "" -using Microsoft.AspNetCore.Mvc.Rendering; - -#line default -#line hidden -#line 6 "" -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -#line default -#line hidden - public class TestFiles_Input_MultipleModels_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - { - #pragma warning disable 219 - private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -ThisShouldBeGenerated __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Collections.IEnumerable __typeHelper = null; - } - ))(); - } - #pragma warning restore 219 - private static System.Object __o = null; - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - } - #pragma warning restore 1998 - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/MultipleModels.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/MultipleModels.mappings.txt deleted file mode 100644 index 7ae5da4684..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/MultipleModels.mappings.txt +++ /dev/null @@ -1,10 +0,0 @@ -Source Location: (7:0,7 [21] TestFiles/Input/MultipleModels.cshtml) -|ThisShouldBeGenerated| -Generated Location: (763:35,0 [21] ) -|ThisShouldBeGenerated| - -Source Location: (37:1,7 [30] TestFiles/Input/MultipleModels.cshtml) -|System.Collections.IEnumerable| -Generated Location: (867:39,0 [30] ) -|System.Collections.IEnumerable| - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.cs deleted file mode 100644 index 0a61b4636c..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace AspNetCore -{ - #line hidden - using System; - using System.Threading.Tasks; -#line 2 "" -using System.Linq; - -#line default -#line hidden -#line 3 "" -using System.Collections.Generic; - -#line default -#line hidden -#line 4 "" -using Microsoft.AspNetCore.Mvc; - -#line default -#line hidden -#line 5 "" -using Microsoft.AspNetCore.Mvc.Rendering; - -#line default -#line hidden -#line 6 "" -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -#line default -#line hidden - public class TestFiles_Input__ViewImports_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - { - #pragma warning disable 219 - private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -IHtmlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Model = null; - } - ))(); - } - #pragma warning restore 219 - private static System.Object __o = null; - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - } - #pragma warning restore 1998 - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public IHtmlHelper Model { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } - [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] - public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } - } -} diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.mappings.txt deleted file mode 100644 index 5c7b32d060..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.mappings.txt +++ /dev/null @@ -1,10 +0,0 @@ -Source Location: (8:0,8 [19] TestFiles/Input/_ViewImports.cshtml) -|IHtmlHelper| -Generated Location: (738:35,0 [19] ) -|IHtmlHelper| - -Source Location: (28:0,28 [5] TestFiles/Input/_ViewImports.cshtml) -|Model| -Generated Location: (854:39,14 [5] ) -|Model| - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs deleted file mode 100644 index cd5cc5dd3c..0000000000 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs +++ /dev/null @@ -1,73 +0,0 @@ -#pragma checksum "TestFiles/Input/Basic.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "54a70ff4c6d27ac6cdc6725cb6bab12012015729" -namespace AspNetCore -{ - #line hidden - using System; - using System.Threading.Tasks; -#line 2 "" -using System.Linq; - -#line default -#line hidden -#line 3 "" -using System.Collections.Generic; - -#line default -#line hidden -#line 4 "" -using Microsoft.AspNetCore.Mvc; - -#line default -#line hidden -#line 5 "" -using Microsoft.AspNetCore.Mvc.Rendering; - -#line default -#line hidden -#line 6 "" -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -#line default -#line hidden - public class TestFiles_Input_Basic_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - { - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - BeginContext(0, 4, true); - WriteLiteral("