diff --git a/samples/TagHelperSample.Web/Views/_GlobalImport.cshtml b/samples/TagHelperSample.Web/Views/_ViewImports.cshtml similarity index 100% rename from samples/TagHelperSample.Web/Views/_GlobalImport.cshtml rename to samples/TagHelperSample.Web/Views/_ViewImports.cshtml diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs index 26b5d829b0..e4eb66afe6 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/ChunkInheritanceUtility.cs @@ -14,7 +14,7 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc.Razor.Directives { /// - /// A utility type for supporting inheritance of directives into a page from applicable _GlobalImport pages. + /// A utility type for supporting inheritance of directives into a page from applicable _ViewImports pages. /// public class ChunkInheritanceUtility { @@ -25,7 +25,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives /// /// Initializes a new instance of . /// - /// The used to parse _GlobalImport pages. + /// The used to parse _ViewImports pages. /// that caches instances. /// /// Sequence of s inherited by default. @@ -40,27 +40,27 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives /// /// Gets an ordered of parsed for each - /// _GlobalImport that is applicable to the page located at . The list is - /// ordered so that the for the _GlobalImport closest to the + /// _ViewImports that is applicable to the page located at . The list is + /// ordered so that the for the _ViewImports closest to the /// in the file system appears first. /// /// The path of the page to locate inherited chunks for. - /// A of parsed _GlobalImport + /// A of parsed _ViewImports /// s. public virtual IReadOnlyList GetInheritedCodeTrees([NotNull] string pagePath) { var inheritedCodeTrees = new List(); var templateEngine = new RazorTemplateEngine(_razorHost); - foreach (var globalImportPath in ViewHierarchyUtility.GetGlobalImportLocations(pagePath)) + foreach (var viewImportsPath in ViewHierarchyUtility.GetViewImportsLocations(pagePath)) { - // globalImportPath contains the app-relative path of the _GlobalImport. - // Since the parsing of a _GlobalImport would cause parent _GlobalImports to be parsed + // viewImportsPath contains the app-relative path of the _ViewImports. + // Since the parsing of a _ViewImports would cause parent _ViewImports to be parsed // we need to ensure the paths are app-relative to allow the GetGlobalFileLocations - // for the current _GlobalImport to succeed. - var codeTree = _codeTreeCache.GetOrAdd(globalImportPath, + // for the current _ViewImports to succeed. + var codeTree = _codeTreeCache.GetOrAdd(viewImportsPath, fileInfo => ParseViewFile(templateEngine, fileInfo, - globalImportPath)); + viewImportsPath)); if (codeTree != null) { @@ -73,10 +73,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives /// /// Merges inherited by default and instances produced by parsing - /// _GlobalImport files into the specified . + /// _ViewImports files into the specified . /// /// The to merge in to. - /// inherited from _GlobalImport + /// inherited from _ViewImports /// files. /// The list of chunks to merge. public void MergeInheritedCodeTrees([NotNull] CodeTree codeTree, @@ -99,7 +99,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives // In the second phase we invoke IChunkMerger.Merge for each chunk that has a mapped merger. // During this phase, the merger can either add to the CodeTree or ignore the chunk based on the merging // rules. - // Read the chunks outside in - that is chunks from the _GlobalImport closest to the page get merged in first + // Read the chunks outside in - that is chunks from the _ViewImports closest to the page get merged in first // and the furthest one last. This allows the merger to ignore a directive like @model that was previously // seen. var chunksToMerge = inheritedCodeTrees.SelectMany(tree => tree.Chunks) @@ -126,18 +126,18 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives private static CodeTree ParseViewFile(RazorTemplateEngine engine, IFileInfo fileInfo, - string globalImportPath) + string viewImportsPath) { using (var stream = fileInfo.CreateReadStream()) { using (var streamReader = new StreamReader(stream)) { - var parseResults = engine.ParseTemplate(streamReader, globalImportPath); + var parseResults = engine.ParseTemplate(streamReader, viewImportsPath); var className = ParserHelpers.SanitizeClassName(fileInfo.Name); var language = engine.Host.CodeLanguage; var codeGenerator = language.CreateCodeGenerator(className, engine.Host.DefaultNamespace, - globalImportPath, + viewImportsPath, engine.Host); codeGenerator.Visit(parseResults); @@ -146,7 +146,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives foreach (var chunk in codeTree.Chunks) { chunk.Start = new SourceLocation( - globalImportPath, + viewImportsPath, chunk.Start.AbsoluteIndex, chunk.Start.LineIndex, chunk.Start.CharacterIndex); diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/DefaultCodeTreeCache.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/DefaultCodeTreeCache.cs index 1c10a27b9d..b43a0a86a4 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/DefaultCodeTreeCache.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/DefaultCodeTreeCache.cs @@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives var pagePath = cacheSetContext.Key; var getCodeTree = (Func)cacheSetContext.State; - // GetOrAdd is invoked for each _ViewStart that might potentially exist in the path. + // GetOrAdd is invoked for each _ViewImports that might potentially exist in the path. // We can avoid performing file system lookups for files that do not exist by caching // negative results and adding a Watch for that file. cacheSetContext.AddExpirationTrigger(_fileProvider.Watch(pagePath)); diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorParser.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorParser.cs index 60243e108f..24462e42c5 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorParser.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorParser.cs @@ -17,11 +17,11 @@ namespace Microsoft.AspNet.Mvc.Razor { /// /// A subtype of that uses to support inheritance of tag - /// helpers from _GlobalImport files. + /// helpers from _ViewImports files. /// public class MvcRazorParser : RazorParser { - private readonly IEnumerable _globalImportDirectiveDescriptors; + private readonly IEnumerable _viewImportsDirectiveDescriptors; private readonly string _modelExpressionTypeName; /// @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// /// The to copy properties from. /// The s that are inherited - /// from parsed pages from _GlobalImport files. + /// from parsed pages from _ViewImports files. /// The inherited by /// default by all Razor pages in the application. public MvcRazorParser( @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Mvc.Razor : base(parser) { // Construct tag helper descriptors from @addTagHelper, @removeTagHelper and @tagHelperPrefix chunks - _globalImportDirectiveDescriptors = GetTagHelperDirectiveDescriptors( + _viewImportsDirectiveDescriptors = GetTagHelperDirectiveDescriptors( inheritedCodeTrees, defaultInheritedChunks); @@ -52,9 +52,9 @@ namespace Microsoft.AspNet.Mvc.Razor [NotNull] Block documentRoot, [NotNull] ErrorSink errorSink) { - var visitor = new GlobalImportTagHelperDirectiveSpanVisitor( + var visitor = new ViewImportsTagHelperDirectiveSpanVisitor( TagHelperDescriptorResolver, - _globalImportDirectiveDescriptors, + _viewImportsDirectiveDescriptors, errorSink); var descriptors = visitor.GetDescriptors(documentRoot); @@ -86,13 +86,13 @@ namespace Microsoft.AspNet.Mvc.Razor var descriptors = new List(); // For tag helpers, the @removeTagHelper only applies tag helpers that were added prior to it. - // Consequently we must visit tag helpers outside-in - furthest _GlobalImport first and nearest one last. + // Consequently we must visit tag helpers outside-in - furthest _ViewImports first and nearest one last. // This is different from the behavior of chunk merging where we visit the nearest one first and ignore // chunks that were previously visited. - var chunksFromGlobalImports = inheritedCodeTrees + var chunksFromViewImports = inheritedCodeTrees .Reverse() .SelectMany(tree => tree.Chunks); - var chunksInOrder = defaultInheritedChunks.Concat(chunksFromGlobalImports); + var chunksInOrder = defaultInheritedChunks.Concat(chunksFromViewImports); foreach (var chunk in chunksInOrder) { // All TagHelperDirectiveDescriptors created here have undefined source locations because the source @@ -138,24 +138,24 @@ namespace Microsoft.AspNet.Mvc.Razor return descriptors; } - private class GlobalImportTagHelperDirectiveSpanVisitor : TagHelperDirectiveSpanVisitor + private class ViewImportsTagHelperDirectiveSpanVisitor : TagHelperDirectiveSpanVisitor { - private readonly IEnumerable _globalImportDirectiveDescriptors; + private readonly IEnumerable _viewImportsDirectiveDescriptors; - public GlobalImportTagHelperDirectiveSpanVisitor( + public ViewImportsTagHelperDirectiveSpanVisitor( ITagHelperDescriptorResolver descriptorResolver, - IEnumerable globalImportDirectiveDescriptors, + IEnumerable viewImportsDirectiveDescriptors, ErrorSink errorSink) : base(descriptorResolver, errorSink) { - _globalImportDirectiveDescriptors = globalImportDirectiveDescriptors; + _viewImportsDirectiveDescriptors = viewImportsDirectiveDescriptors; } protected override TagHelperDescriptorResolutionContext GetTagHelperDescriptorResolutionContext( IEnumerable descriptors, ErrorSink errorSink) { - var directivesToImport = MergeDirectiveDescriptors(descriptors, _globalImportDirectiveDescriptors); + var directivesToImport = MergeDirectiveDescriptors(descriptors, _viewImportsDirectiveDescriptors); return base.GetTagHelperDescriptorResolutionContext(directivesToImport, errorSink); } diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/ViewHierarchyUtility.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/ViewHierarchyUtility.cs index f5317f5f5f..9824ac3cf3 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/ViewHierarchyUtility.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/ViewHierarchyUtility.cs @@ -9,12 +9,12 @@ using System.Linq; namespace Microsoft.AspNet.Mvc.Razor { /// - /// Contains methods to locate _ViewStart.cshtml and _GlobalImport.cshtml + /// Contains methods to locate _ViewStart.cshtml and _ViewImports.cshtml /// public static class ViewHierarchyUtility { private const string ViewStartFileName = "_ViewStart.cshtml"; - private const string GlobalImportFileName = "_GlobalImport.cshtml"; + private const string ViewImportsFileName = "_ViewImports.cshtml"; /// /// Gets the view start locations that are applicable to the specified path. @@ -34,21 +34,21 @@ namespace Microsoft.AspNet.Mvc.Razor } /// - /// Gets the locations for _GlobalImports that are applicable to the specified path. + /// Gets the locations for _ViewImportss that are applicable to the specified path. /// /// The application relative path of the file to locate - /// _GlobalImports for. - /// A sequence of paths that represent potential _GlobalImport locations. + /// _ViewImportss for. + /// A sequence of paths that represent potential _ViewImports locations. /// /// This method returns paths starting from the directory of and /// moves upwards until it hits the application root. /// e.g. - /// /Views/Home/View.cshtml -> [ /Views/Home/_GlobalImport.cshtml, /Views/_GlobalImport.cshtml, - /// /_GlobalImport.cshtml ] + /// /Views/Home/View.cshtml -> [ /Views/Home/_ViewImports.cshtml, /Views/_ViewImports.cshtml, + /// /_ViewImports.cshtml ] /// - public static IEnumerable GetGlobalImportLocations(string applicationRelativePath) + public static IEnumerable GetViewImportsLocations(string applicationRelativePath) { - return GetHierarchicalPath(applicationRelativePath, GlobalImportFileName); + return GetHierarchicalPath(applicationRelativePath, ViewImportsFileName); } private static IEnumerable GetHierarchicalPath(string relativePath, string fileName) diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs index 0422c39e69..7be2386633 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs @@ -64,16 +64,16 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation } } - // Set up _GlobalImports + // Set up _ViewImports foreach (var entry in cacheEntries) { - var globalFileLocations = ViewHierarchyUtility.GetGlobalImportLocations(entry.RelativePath); + var globalFileLocations = ViewHierarchyUtility.GetViewImportsLocations(entry.RelativePath); foreach (var location in globalFileLocations) { var globalFileEntry = _cache.Get(location); if (globalFileEntry != null) { - // Add the the composite _GlobalImport entry as a dependency. + // Add the composite _ViewImports entry as a dependency. entry.AssociatedGlobalFileEntry = globalFileEntry; break; } @@ -113,7 +113,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation else if (cacheEntry.IsPreCompiled && !cacheEntry.IsValidatedPreCompiled) { // For precompiled views, the first time the entry is read, we need to ensure that no changes were made - // either to the file associated with this entry, or any _GlobalImport associated with it between the time + // either to the file associated with this entry, or any _ViewImports associated with it between the time // the View was precompiled and the time EnsureInitialized was called. For later iterations, we can // rely on expiration triggers ensuring the validity of the entry. @@ -132,7 +132,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation if (AssociatedGlobalFilesChanged(cacheEntry, compile)) { - // Recompile if _GlobalImports have changed since the entry was created. + // Recompile if _ViewImports have changed since the entry was created. return OnCacheMiss(relativeFileInfo, normalizedPath, compile); } @@ -199,8 +199,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation var entry = (CompilerCacheEntry)cacheSetContext.State; cacheSetContext.AddExpirationTrigger(_fileProvider.Watch(entry.RelativePath)); - var globalImportPaths = ViewHierarchyUtility.GetGlobalImportLocations(cacheSetContext.Key); - foreach (var location in globalImportPaths) + var viewImportsPaths = ViewHierarchyUtility.GetViewImportsLocations(cacheSetContext.Key); + foreach (var location in viewImportsPaths) { cacheSetContext.AddExpirationTrigger(_fileProvider.Watch(location)); } @@ -215,24 +215,24 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation return entry.AssociatedGlobalFileEntry != globalFileEntry; } - // Returns the entry for the nearest _GlobalImport that the file inherits directives from. Since _GlobalImport - // entries are affected by other _GlobalImport entries that are in the path hierarchy, the returned value - // represents the composite result of performing a cache check on individual _GlobalImport entries. + // Returns the entry for the nearest _ViewImports that the file inherits directives from. Since _ViewImports + // entries are affected by other _ViewImports entries that are in the path hierarchy, the returned value + // represents the composite result of performing a cache check on individual _ViewImports entries. private CompilerCacheEntry GetCompositeGlobalFileEntry(string relativePath, Func compile) { - var globalImportLocations = ViewHierarchyUtility.GetGlobalImportLocations(relativePath); - foreach (var globalImport in globalImportLocations) + var viewImportsLocations = ViewHierarchyUtility.GetViewImportsLocations(relativePath); + foreach (var viewImports in viewImportsLocations) { - var getOrAddResult = GetOrAddCore(globalImport, compile); + var getOrAddResult = GetOrAddCore(viewImports, compile); if (getOrAddResult != null) { - // This is the nearest _GlobalImport that exists on disk. + // This is the nearest _ViewImports that exists on disk. return getOrAddResult.CompilerCacheEntry; } } - // No _GlobalImports discovered. + // No _ViewImports discovered. return null; } diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCacheEntry.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCacheEntry.cs index e295b8e9d9..dac6e16a70 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCacheEntry.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCacheEntry.cs @@ -80,7 +80,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation public bool IsPreCompiled { get; } /// - /// Gets or sets the for the nearest _GlobalImport that the compiled type + /// Gets or sets the for the nearest _ViewImports that the compiled type /// depends on. /// public CompilerCacheEntry AssociatedGlobalFileEntry { get; set; } diff --git a/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs b/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs index 48e9085e48..217c884212 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs @@ -198,7 +198,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation if (entry != null) { cacheSetContext.AddExpirationTrigger(FileProvider.Watch(fileInfo.RelativePath)); - foreach (var path in ViewHierarchyUtility.GetGlobalImportLocations(fileInfo.RelativePath)) + foreach (var path in ViewHierarchyUtility.GetViewImportsLocations(fileInfo.RelativePath)) { cacheSetContext.AddExpirationTrigger(FileProvider.Watch(path)); } diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/DirectivesTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/DirectivesTest.cs index 2b344f5acd..0d76e5105f 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/DirectivesTest.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/DirectivesTest.cs @@ -24,7 +24,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests var client = server.CreateClient(); // Act - var body = await client.GetStringAsync("http://localhost/Directives/ViewInheritsInjectAndUsingsFromGlobalImports"); + var body = await client.GetStringAsync("http://localhost/Directives/ViewInheritsInjectAndUsingsFromViewImports"); // Assert Assert.Equal(expected, body.Trim()); @@ -38,7 +38,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests var client = server.CreateClient(); // Act - var body = await client.GetStringAsync("http://localhost/Directives/ViewInheritsBasePageFromGlobalImports"); + var body = await client.GetStringAsync("http://localhost/Directives/ViewInheritsBasePageFromViewImports"); // Assert Assert.Equal(expected, body.Trim()); diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ErrorPageTests.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ErrorPageTests.cs index fa8c4b336c..579ad3af74 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ErrorPageTests.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/ErrorPageTests.cs @@ -49,7 +49,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests } [Fact] - public async Task CompilationFailuresFromGlobalImportAreListed() + public async Task CompilationFailuresFromViewImportsAreListed() { // Arrange var expectedMessage = "The type or namespace name 'NamespaceDoesNotExist' could not be found (" @@ -59,13 +59,13 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests var expectedMediaType = MediaTypeHeaderValue.Parse("text/html"); // Act - var response = await client.GetAsync("http://localhost/ErrorFromGlobalImport"); + var response = await client.GetAsync("http://localhost/ErrorFromViewImports"); // Assert Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); var content = await response.Content.ReadAsStringAsync(); - Assert.Contains(@"Views\ErrorFromGlobalImport\_GlobalImport.cshtml", content); + Assert.Contains(@"Views\ErrorFromViewImports\_ViewImports.cshtml", content); Assert.Contains(expectedMessage, content); } } diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/PrecompilationTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/PrecompilationTest.cs index 2633a64a81..3b28de0c25 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/PrecompilationTest.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/PrecompilationTest.cs @@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests var layoutContent = File.ReadAllText(Path.Combine(viewsDirectory, "Layout.cshtml")); var indexContent = File.ReadAllText(Path.Combine(viewsDirectory, "Index.cshtml")); var viewstartContent = File.ReadAllText(Path.Combine(viewsDirectory, "_ViewStart.cshtml")); - var globalContent = File.ReadAllText(Path.Combine(viewsDirectory, "_GlobalImport.cshtml")); + var globalContent = File.ReadAllText(Path.Combine(viewsDirectory, "_ViewImports.cshtml")); // We will render a view that writes the fully qualified name of the Assembly containing the type of // the view. If the view is precompiled, this assembly will be PrecompilationWebsite. @@ -85,8 +85,8 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests Assert.Equal(response2.Layout, response3.Layout); // Act - 4 - // Touch the _GlobalImport file and verify it causes all files to recompile. - await TouchFile(viewsDirectory, "_GlobalImport.cshtml"); + // Touch the _ViewImports file and verify it causes all files to recompile. + await TouchFile(viewsDirectory, "_ViewImports.cshtml"); responseContent = await client.GetStringAsync("http://localhost/Home/Index"); // Assert - 4 @@ -108,8 +108,8 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests Assert.NotEqual(response4.Index, response5.Index); // Act - 6 - // Touch the _GlobalImport file. This time, we'll verify the Non-precompiled -> Non-precompiled workflow. - await TouchFile(viewsDirectory, "_GlobalImport.cshtml"); + // Touch the _ViewImports file. This time, we'll verify the Non-precompiled -> Non-precompiled workflow. + await TouchFile(viewsDirectory, "_ViewImports.cshtml"); responseContent = await client.GetStringAsync("http://localhost/Home/Index"); // Assert - 6 @@ -120,8 +120,8 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests Assert.NotEqual(response5.Layout, response6.Layout); // Act - 7 - // Add a new _GlobalImport file - var newGlobalImport = await TouchFile(Path.GetDirectoryName(viewsDirectory), "_GlobalImport.cshtml"); + // Add a new _ViewImports file + var newViewImports = await TouchFile(Path.GetDirectoryName(viewsDirectory), "_ViewImports.cshtml"); responseContent = await client.GetStringAsync("http://localhost/Home/Index"); // Assert - 7 @@ -132,8 +132,8 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests Assert.NotEqual(response6.Layout, response7.Layout); // Act - 8 - // Remove new _GlobalImport file - File.Delete(newGlobalImport); + // Remove new _ViewImports file + File.Delete(newViewImports); await Task.Delay(_cacheDelayInterval); responseContent = await client.GetStringAsync("http://localhost/Home/Index"); @@ -159,7 +159,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests File.WriteAllText(Path.Combine(viewsDirectory, "Layout.cshtml"), layoutContent.TrimEnd(' ')); File.WriteAllText(Path.Combine(viewsDirectory, "Index.cshtml"), indexContent.TrimEnd(' ')); File.WriteAllText(Path.Combine(viewsDirectory, "_ViewStart.cshtml"), viewstartContent.TrimEnd(' ')); - File.WriteAllText(Path.Combine(viewsDirectory, "_GlobalImport.cshtml"), globalContent.TrimEnd(' ')); + File.WriteAllText(Path.Combine(viewsDirectory, "_ViewImports.cshtml"), globalContent.TrimEnd(' ')); } } @@ -205,8 +205,8 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests var viewsDirectory = Path.Combine(applicationEnvironment.ApplicationBasePath, "Views", - "GlobalImportDelete"); - var globalPath = Path.Combine(viewsDirectory, "_GlobalImport.cshtml"); + "ViewImportsDelete"); + var globalPath = Path.Combine(viewsDirectory, "_ViewImports.cshtml"); var globalContent = File.ReadAllText(globalPath); // Act - 1 diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/TagHelpersTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/TagHelpersTest.cs index bba131da64..c1c829e3b2 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/TagHelpersTest.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/TagHelpersTest.cs @@ -55,7 +55,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests Assert.Equal(expectedContent, responseContent); } - public static TheoryData TagHelpersAreInheritedFromGlobalImportPagesData + public static TheoryData TagHelpersAreInheritedFromViewImportsPagesData { get { @@ -63,7 +63,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests return new TheoryData { { - "NestedGlobalImportTagHelper", + "NestedViewImportsTagHelper", string.Format( "root-content{0}{0}{0}nested-content", Environment.NewLine) @@ -109,8 +109,8 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests } [Theory] - [MemberData(nameof(TagHelpersAreInheritedFromGlobalImportPagesData))] - public async Task TagHelpersAreInheritedFromGlobalImportPages(string action, string expected) + [MemberData(nameof(TagHelpersAreInheritedFromViewImportsPagesData))] + public async Task TagHelpersAreInheritedFromViewImportsPages(string action, string expected) { // Arrange var server = TestHelper.CreateServer(_app, SiteName, _configureServices); diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/ViewEngineTests.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/ViewEngineTests.cs index 58b9006045..a76e1a2303 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/ViewEngineTests.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/ViewEngineTests.cs @@ -323,7 +323,7 @@ View With Layout Hello Controller-Person"; var server = TestHelper.CreateServer(_app, SiteName, _configureServices); var client = server.CreateClient(); - var target = "http://localhost/NestedGlobalImports"; + var target = "http://localhost/NestedViewImports"; // Act var body = await client.GetStringAsync(target); diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs index 10ef75c77b..0f52bf1ce9 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/Directives/ChunkInheritanceUtilityTest.cs @@ -13,10 +13,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives { // Arrange var fileProvider = new TestFileProvider(); - fileProvider.AddFile(@"Views\accounts\_GlobalImport.cshtml", "@using AccountModels"); - fileProvider.AddFile(@"Views\Shared\_GlobalImport.cshtml", "@inject SharedHelper Shared"); - fileProvider.AddFile(@"Views\home\_GlobalImport.cshtml", "@using MyNamespace"); - fileProvider.AddFile(@"Views\_GlobalImport.cshtml", + fileProvider.AddFile(@"Views\accounts\_ViewImports.cshtml", "@using AccountModels"); + fileProvider.AddFile(@"Views\Shared\_ViewImports.cshtml", "@inject SharedHelper Shared"); + fileProvider.AddFile(@"Views\home\_ViewImports.cshtml", "@using MyNamespace"); + fileProvider.AddFile(@"Views\_ViewImports.cshtml", @"@inject MyHelper Helper @inherits MyBaseType @@ -41,67 +41,67 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives Assert.Collection(codeTrees, codeTree => { - var globalImportPath = @"Views\home\_GlobalImport.cshtml"; + var viewImportsPath = @"Views\home\_ViewImports.cshtml"; Assert.Collection(codeTree.Chunks, chunk => { Assert.IsType(chunk); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }, chunk => { var usingChunk = Assert.IsType(chunk); Assert.Equal("MyNamespace", usingChunk.Namespace); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }, chunk => { Assert.IsType(chunk); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }); }, codeTree => { - var globalImportPath = @"Views\_GlobalImport.cshtml"; + var viewImportsPath = @"Views\_ViewImports.cshtml"; Assert.Collection(codeTree.Chunks, chunk => { Assert.IsType(chunk); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }, chunk => { var injectChunk = Assert.IsType(chunk); Assert.Equal("MyHelper", injectChunk.TypeName); Assert.Equal("Helper", injectChunk.MemberName); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }, chunk => { Assert.IsType(chunk); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }, chunk => { var setBaseTypeChunk = Assert.IsType(chunk); Assert.Equal("MyBaseType", setBaseTypeChunk.TypeName); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }, chunk => { Assert.IsType(chunk); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }, chunk => { Assert.IsType(chunk); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }, chunk => { Assert.IsType(chunk); - Assert.Equal(globalImportPath, chunk.Start.FilePath); + Assert.Equal(viewImportsPath, chunk.Start.FilePath); }); }); } @@ -111,9 +111,9 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives { // Arrange var fileProvider = new TestFileProvider(); - fileProvider.AddFile(@"_GlobalImport.cs", string.Empty); + fileProvider.AddFile(@"_ViewImports.cs", string.Empty); fileProvider.AddFile(@"Views\_Layout.cshtml", string.Empty); - fileProvider.AddFile(@"Views\home\_not-globalimport.cshtml", string.Empty); + fileProvider.AddFile(@"Views\home\_not-viewimports.cshtml", string.Empty); var cache = new DefaultCodeTreeCache(fileProvider); var host = new MvcRazorHost(cache); var defaultChunks = new Chunk[] @@ -135,7 +135,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives { // Arrange var fileProvider = new TestFileProvider(); - fileProvider.AddFile(@"Views\_GlobalImport.cshtml", + fileProvider.AddFile(@"Views\_ViewImports.cshtml", "@inject DifferentHelper Html"); var cache = new DefaultCodeTreeCache(fileProvider); var host = new MvcRazorHost(cache); diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs index 447dc387dc..c289e3edb3 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Mvc.Razor { public class MvcRazorCodeParserTest { - public static TheoryData GlobalImportData + public static TheoryData ViewImportsData { get { @@ -135,7 +135,7 @@ namespace Microsoft.AspNet.Mvc.Razor } [Theory] - [MemberData(nameof(GlobalImportData))] + [MemberData(nameof(ViewImportsData))] public void GetTagHelperDescriptors_ReturnsExpectedDirectiveDescriptors( CodeTree[] codeTrees, TagHelperDirectiveDescriptor[] expectedDirectiveDescriptors) diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ViewHierarchyUtilityTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ViewHierarchyUtilityTest.cs index 755227a1c3..d82148d8c6 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ViewHierarchyUtilityTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ViewHierarchyUtilityTest.cs @@ -23,10 +23,10 @@ namespace Microsoft.AspNet.Mvc.Razor [Theory] [InlineData(null)] [InlineData("")] - public void GetGlobalImportLocations_ReturnsEmptySequenceIfViewPathIsEmpty(string viewPath) + public void GetViewImportsLocations_ReturnsEmptySequenceIfViewPathIsEmpty(string viewPath) { // Act - var result = ViewHierarchyUtility.GetGlobalImportLocations(viewPath); + var result = ViewHierarchyUtility.GetViewImportsLocations(viewPath); // Assert Assert.Empty(result); @@ -57,18 +57,18 @@ namespace Microsoft.AspNet.Mvc.Razor [InlineData("/Views/Home/MyView.cshtml")] [InlineData("~/Views/Home/MyView.cshtml")] [InlineData("Views/Home/MyView.cshtml")] - public void GetGlobalImportLocations_ReturnsPotentialViewStartLocations_PathStartswithSlash(string inputPath) + public void GetViewImportsLocations_ReturnsPotentialViewStartLocations_PathStartswithSlash(string inputPath) { // Arrange var expected = new[] { - @"Views\Home\_GlobalImport.cshtml", - @"Views\_GlobalImport.cshtml", - @"_GlobalImport.cshtml" + @"Views\Home\_ViewImports.cshtml", + @"Views\_ViewImports.cshtml", + @"_ViewImports.cshtml" }; // Act - var result = ViewHierarchyUtility.GetGlobalImportLocations(inputPath); + var result = ViewHierarchyUtility.GetViewImportsLocations(inputPath); // Assert Assert.Equal(expected, result); @@ -98,38 +98,38 @@ namespace Microsoft.AspNet.Mvc.Razor [InlineData("/Views/Home/_ViewStart.cshtml")] [InlineData("~/Views/Home/_ViewStart.cshtml")] [InlineData("Views/Home/_ViewStart.cshtml")] - public void GetGlobalImportLocations_WhenCurrentIsViewStart(string inputPath) + public void GetViewImportsLocations_WhenCurrentIsViewStart(string inputPath) { // Arrange var expected = new[] { - @"Views\Home\_GlobalImport.cshtml", - @"Views\_GlobalImport.cshtml", - @"_GlobalImport.cshtml" + @"Views\Home\_ViewImports.cshtml", + @"Views\_ViewImports.cshtml", + @"_ViewImports.cshtml" }; // Act - var result = ViewHierarchyUtility.GetGlobalImportLocations(inputPath); + var result = ViewHierarchyUtility.GetViewImportsLocations(inputPath); // Assert Assert.Equal(expected, result); } [Theory] - [InlineData("/Views/Home/_GlobalImport.cshtml")] - [InlineData("~/Views/Home/_GlobalImport.cshtml")] - [InlineData("Views/Home/_GlobalImport.cshtml")] - public void GetGlobalImportLocations_SkipsCurrentPath_IfCurrentIsGlobalImport(string inputPath) + [InlineData("/Views/Home/_ViewImports.cshtml")] + [InlineData("~/Views/Home/_ViewImports.cshtml")] + [InlineData("Views/Home/_ViewImports.cshtml")] + public void GetViewImportsLocations_SkipsCurrentPath_IfCurrentIsViewImports(string inputPath) { // Arrange var expected = new[] { - @"Views\_GlobalImport.cshtml", - @"_GlobalImport.cshtml" + @"Views\_ViewImports.cshtml", + @"_ViewImports.cshtml" }; // Act - var result = ViewHierarchyUtility.GetGlobalImportLocations(inputPath); + var result = ViewHierarchyUtility.GetViewImportsLocations(inputPath); // Assert Assert.Equal(expected, result); @@ -163,22 +163,22 @@ namespace Microsoft.AspNet.Mvc.Razor [InlineData("Test.cshtml")] [InlineData("Global.cshtml")] [InlineData("_ViewStart.cshtml")] - public void GetGlobalImportLocations_ReturnsPotentialGlobalLocations(string fileName) + public void GetViewImportsLocations_ReturnsPotentialGlobalLocations(string fileName) { // Arrange var expected = new[] { - @"Areas\MyArea\Sub\Views\Admin\_GlobalImport.cshtml", - @"Areas\MyArea\Sub\Views\_GlobalImport.cshtml", - @"Areas\MyArea\Sub\_GlobalImport.cshtml", - @"Areas\MyArea\_GlobalImport.cshtml", - @"Areas\_GlobalImport.cshtml", - @"_GlobalImport.cshtml", + @"Areas\MyArea\Sub\Views\Admin\_ViewImports.cshtml", + @"Areas\MyArea\Sub\Views\_ViewImports.cshtml", + @"Areas\MyArea\Sub\_ViewImports.cshtml", + @"Areas\MyArea\_ViewImports.cshtml", + @"Areas\_ViewImports.cshtml", + @"_ViewImports.cshtml", }; var viewPath = Path.Combine("Areas", "MyArea", "Sub", "Views", "Admin", fileName); // Act - var result = ViewHierarchyUtility.GetGlobalImportLocations(viewPath); + var result = ViewHierarchyUtility.GetViewImportsLocations(viewPath); // Assert Assert.Equal(expected, result); @@ -234,13 +234,13 @@ namespace Microsoft.AspNet.Mvc.Razor } [Fact] - public void GetGlobalImportLocations_ReturnsEmptySequence_IfPathIsRooted() + public void GetViewImportsLocations_ReturnsEmptySequence_IfPathIsRooted() { // Arrange var absolutePath = Path.Combine(Directory.GetCurrentDirectory(), "Index.cshtml"); // Act - var result = ViewHierarchyUtility.GetGlobalImportLocations(absolutePath); + var result = ViewHierarchyUtility.GetViewImportsLocations(absolutePath); // Assert Assert.Empty(result); diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/CompilerCacheTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/CompilerCacheTest.cs index 43526b2d91..8ff44f34d2 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/CompilerCacheTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/CompilerCacheTest.cs @@ -267,14 +267,14 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation Content = globalContent, LastModified = DateTime.UtcNow }; - fileProvider.AddFile("_GlobalImport.cshtml", globalFileInfo); + fileProvider.AddFile("_ViewImports.cshtml", globalFileInfo); var globalRazorFileInfo = new RazorFileInfo { Hash = Crc32.Calculate(GetMemoryStream(globalContent)).ToString(CultureInfo.InvariantCulture), HashAlgorithmVersion = 1, LastModified = globalFileInfo.LastModified, Length = globalFileInfo.Length, - RelativePath = "_GlobalImport.cshtml", + RelativePath = "_ViewImports.cshtml", FullTypeName = typeof(RuntimeCompileIdentical).FullName }; var precompiledViews = new ViewCollection(); @@ -349,7 +349,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation } [Fact] - public void GetOrAdd_IgnoresCachedValueIfFileIsIdentical_ButGlobalImportWasAdedSinceTheCacheWasCreated() + public void GetOrAdd_IgnoresCachedValueIfFileIsIdentical_ButViewImportsWasAdedSinceTheCacheWasCreated() { // Arrange var expectedType = typeof(RuntimeCompileDifferent); @@ -378,7 +378,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation Assert.Equal(typeof(PreCompile), actual1.CompiledType); // Act 2 - var globalTrigger = fileProvider.GetTrigger("Views\\_GlobalImport.cshtml"); + var globalTrigger = fileProvider.GetTrigger("Views\\_ViewImports.cshtml"); globalTrigger.IsExpired = true; var result2 = cache.GetOrAdd(testFile.PhysicalPath, compile: _ => CompilationResult.Successful(expectedType)); @@ -411,7 +411,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation var globalFileInfo = new TestFileInfo { - PhysicalPath = "Views\\_GlobalImport.cshtml", + PhysicalPath = "Views\\_ViewImports.cshtml", Content = "viewstart-content", LastModified = lastModified }; @@ -460,7 +460,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation var contentStream = GetMemoryStream(globalContent); var lastModified = DateTime.UtcNow; int length = Encoding.UTF8.GetByteCount(globalContent); - var path = "Views\\_GlobalImport.cshtml"; + var path = "Views\\_ViewImports.cshtml"; var razorFileInfo = new RazorFileInfo { diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RazorCompilationServiceTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RazorCompilationServiceTest.cs index d996146935..b1cf4a0c57 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RazorCompilationServiceTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/RazorCompilationServiceTest.cs @@ -125,12 +125,12 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation { // Arrange var viewPath = @"views/index.razor"; - var globalImportPath = @"views/global.import.cshtml"; + var viewImportsPath = @"views/global.import.cshtml"; var host = Mock.Of(); var fileProvider = new TestFileProvider(); var file = fileProvider.AddFile(viewPath, "View Content"); - fileProvider.AddFile(globalImportPath, "Global Import Content"); + fileProvider.AddFile(viewImportsPath, "Global Import Content"); var relativeFileInfo = new RelativeFileInfo(file, viewPath); var razorService = new RazorCompilationService( Mock.Of(), @@ -141,7 +141,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation new RazorError("message-1", new SourceLocation(1, 2, 17)), new RazorError("message-2", new SourceLocation(viewPath, 1, 4, 6), 7), new RazorError { Message = "message-3" }, - new RazorError("message-4", new SourceLocation(globalImportPath, 1, 3, 8), 4), + new RazorError("message-4", new SourceLocation(viewImportsPath, 1, 3, 8), 4), }; // Act @@ -185,13 +185,13 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation }, failure => { - Assert.Equal(globalImportPath, failure.SourceFilePath); + Assert.Equal(viewImportsPath, failure.SourceFilePath); Assert.Equal("Global Import Content", failure.SourceFileContent); Assert.Collection(failure.Messages, message => { Assert.Equal(errors[3].Message, message.Message); - Assert.Equal(globalImportPath, message.SourceFilePath); + Assert.Equal(viewImportsPath, message.SourceFilePath); Assert.Equal(4, message.StartLine); Assert.Equal(8, message.StartColumn); Assert.Equal(4, message.EndLine); diff --git a/test/WebSites/ErrorPageMiddlewareWebSite/ErrorPageMiddlewareController.cs b/test/WebSites/ErrorPageMiddlewareWebSite/ErrorPageMiddlewareController.cs index 36a8705228..803a040b16 100644 --- a/test/WebSites/ErrorPageMiddlewareWebSite/ErrorPageMiddlewareController.cs +++ b/test/WebSites/ErrorPageMiddlewareWebSite/ErrorPageMiddlewareController.cs @@ -19,10 +19,10 @@ namespace ErrorPageMiddlewareWebSite return View(); } - [HttpGet("/ErrorFromGlobalImport")] - public IActionResult GlobalImportError() + [HttpGet("/ErrorFromViewImports")] + public IActionResult ViewImportsError() { - return View("~/Views/ErrorFromGlobalImport/Index"); + return View("~/Views/ErrorFromViewImports/Index"); } } } diff --git a/test/WebSites/ErrorPageMiddlewareWebSite/Views/ErrorFromGlobalImport/Index.cshtml b/test/WebSites/ErrorPageMiddlewareWebSite/Views/ErrorFromViewImports/Index.cshtml similarity index 100% rename from test/WebSites/ErrorPageMiddlewareWebSite/Views/ErrorFromGlobalImport/Index.cshtml rename to test/WebSites/ErrorPageMiddlewareWebSite/Views/ErrorFromViewImports/Index.cshtml diff --git a/test/WebSites/ErrorPageMiddlewareWebSite/Views/ErrorFromGlobalImport/_GlobalImport.cshtml b/test/WebSites/ErrorPageMiddlewareWebSite/Views/ErrorFromViewImports/_ViewImports.cshtml similarity index 100% rename from test/WebSites/ErrorPageMiddlewareWebSite/Views/ErrorFromGlobalImport/_GlobalImport.cshtml rename to test/WebSites/ErrorPageMiddlewareWebSite/Views/ErrorFromViewImports/_ViewImports.cshtml diff --git a/test/WebSites/MvcTagHelpersWebSite/Views/Catalog_CacheTagHelper/_GlobalImport.cshtml b/test/WebSites/MvcTagHelpersWebSite/Views/Catalog_CacheTagHelper/_ViewImports.cshtml similarity index 100% rename from test/WebSites/MvcTagHelpersWebSite/Views/Catalog_CacheTagHelper/_GlobalImport.cshtml rename to test/WebSites/MvcTagHelpersWebSite/Views/Catalog_CacheTagHelper/_ViewImports.cshtml diff --git a/test/WebSites/PrecompilationWebSite/Controllers/HomeController.cs b/test/WebSites/PrecompilationWebSite/Controllers/HomeController.cs index a661c7c84a..3314145d16 100644 --- a/test/WebSites/PrecompilationWebSite/Controllers/HomeController.cs +++ b/test/WebSites/PrecompilationWebSite/Controllers/HomeController.cs @@ -19,7 +19,7 @@ namespace PrecompilationWebSite.Controllers public IActionResult GlobalDeletedPriorToFirstRequest() { - return View("~/Views/GlobalImportDelete/Index"); + return View("~/Views/ViewImportsDelete/Index"); } [HttpGet("/Test")] diff --git a/test/WebSites/PrecompilationWebSite/Views/Home/_GlobalImport.cshtml b/test/WebSites/PrecompilationWebSite/Views/Home/_ViewImports.cshtml similarity index 100% rename from test/WebSites/PrecompilationWebSite/Views/Home/_GlobalImport.cshtml rename to test/WebSites/PrecompilationWebSite/Views/Home/_ViewImports.cshtml diff --git a/test/WebSites/PrecompilationWebSite/Views/TagHelpers/_GlobalImport.cshtml b/test/WebSites/PrecompilationWebSite/Views/TagHelpers/_ViewImports.cshtml similarity index 100% rename from test/WebSites/PrecompilationWebSite/Views/TagHelpers/_GlobalImport.cshtml rename to test/WebSites/PrecompilationWebSite/Views/TagHelpers/_ViewImports.cshtml diff --git a/test/WebSites/PrecompilationWebSite/Views/GlobalImportDelete/Index.cshtml b/test/WebSites/PrecompilationWebSite/Views/ViewImportsDelete/Index.cshtml similarity index 100% rename from test/WebSites/PrecompilationWebSite/Views/GlobalImportDelete/Index.cshtml rename to test/WebSites/PrecompilationWebSite/Views/ViewImportsDelete/Index.cshtml diff --git a/test/WebSites/PrecompilationWebSite/Views/GlobalImportDelete/_GlobalImport.cshtml b/test/WebSites/PrecompilationWebSite/Views/ViewImportsDelete/_ViewImports.cshtml similarity index 100% rename from test/WebSites/PrecompilationWebSite/Views/GlobalImportDelete/_GlobalImport.cshtml rename to test/WebSites/PrecompilationWebSite/Views/ViewImportsDelete/_ViewImports.cshtml diff --git a/test/WebSites/RazorWebSite/Controllers/DirectivesController.cs b/test/WebSites/RazorWebSite/Controllers/DirectivesController.cs index afef99808f..dd8b4a6291 100644 --- a/test/WebSites/RazorWebSite/Controllers/DirectivesController.cs +++ b/test/WebSites/RazorWebSite/Controllers/DirectivesController.cs @@ -7,14 +7,14 @@ namespace RazorWebSite { public class DirectivesController : Controller { - public ViewResult ViewInheritsInjectAndUsingsFromGlobalImports() + public ViewResult ViewInheritsInjectAndUsingsFromViewImports() { return View(new Person { Name = "Person1" }); } - public ViewResult ViewInheritsBasePageFromGlobalImports() + public ViewResult ViewInheritsBasePageFromViewImports() { - return View("/views/directives/scoped/ViewInheritsBasePageFromGlobalImports.cshtml", + return View("/views/directives/scoped/ViewInheritsBasePageFromViewImports.cshtml", new Person { Name = "Person2" }); } } diff --git a/test/WebSites/RazorWebSite/Controllers/NestedGlobalImports.cs b/test/WebSites/RazorWebSite/NestedViewImportsController.cs similarity index 73% rename from test/WebSites/RazorWebSite/Controllers/NestedGlobalImports.cs rename to test/WebSites/RazorWebSite/NestedViewImportsController.cs index 9a9d2f9fa0..e97392b247 100644 --- a/test/WebSites/RazorWebSite/Controllers/NestedGlobalImports.cs +++ b/test/WebSites/RazorWebSite/NestedViewImportsController.cs @@ -5,7 +5,7 @@ using Microsoft.AspNet.Mvc; namespace RazorWebSite.Controllers { - public class NestedGlobalImportsController : Controller + public class NestedViewImportsController : Controller { public ViewResult Index() { @@ -14,7 +14,7 @@ namespace RazorWebSite.Controllers Name = "Controller-Person" }; - return View("~/Views/NestedGlobalImports/Nested/Index.cshtml", model); + return View("~/Views/NestedViewImports/Nested/Index.cshtml", model); } } } \ No newline at end of file diff --git a/test/WebSites/RazorWebSite/Views/Directives/Scoped/ViewInheritsBasePageFromGlobalImports.cshtml b/test/WebSites/RazorWebSite/Views/Directives/Scoped/ViewInheritsBasePageFromViewImports.cshtml similarity index 100% rename from test/WebSites/RazorWebSite/Views/Directives/Scoped/ViewInheritsBasePageFromGlobalImports.cshtml rename to test/WebSites/RazorWebSite/Views/Directives/Scoped/ViewInheritsBasePageFromViewImports.cshtml diff --git a/test/WebSites/RazorWebSite/Views/Directives/Scoped/_GlobalImport.cshtml b/test/WebSites/RazorWebSite/Views/Directives/Scoped/_ViewImports.cshtml similarity index 100% rename from test/WebSites/RazorWebSite/Views/Directives/Scoped/_GlobalImport.cshtml rename to test/WebSites/RazorWebSite/Views/Directives/Scoped/_ViewImports.cshtml diff --git a/test/WebSites/RazorWebSite/Views/Directives/ViewInheritsInjectAndUsingsFromGlobalImports.cshtml b/test/WebSites/RazorWebSite/Views/Directives/ViewInheritsInjectAndUsingsFromViewImports.cshtml similarity index 100% rename from test/WebSites/RazorWebSite/Views/Directives/ViewInheritsInjectAndUsingsFromGlobalImports.cshtml rename to test/WebSites/RazorWebSite/Views/Directives/ViewInheritsInjectAndUsingsFromViewImports.cshtml diff --git a/test/WebSites/RazorWebSite/Views/Directives/_GlobalImport.cshtml b/test/WebSites/RazorWebSite/Views/Directives/_ViewImports.cshtml similarity index 100% rename from test/WebSites/RazorWebSite/Views/Directives/_GlobalImport.cshtml rename to test/WebSites/RazorWebSite/Views/Directives/_ViewImports.cshtml diff --git a/test/WebSites/RazorWebSite/Views/NestedGlobalImports/Nested/Index.cshtml b/test/WebSites/RazorWebSite/Views/NestedViewImports/Nested/Index.cshtml similarity index 100% rename from test/WebSites/RazorWebSite/Views/NestedGlobalImports/Nested/Index.cshtml rename to test/WebSites/RazorWebSite/Views/NestedViewImports/Nested/Index.cshtml diff --git a/test/WebSites/RazorWebSite/Views/NestedGlobalImports/Nested/_GlobalImport.cshtml b/test/WebSites/RazorWebSite/Views/NestedViewImports/Nested/_ViewImports.cshtml similarity index 100% rename from test/WebSites/RazorWebSite/Views/NestedGlobalImports/Nested/_GlobalImport.cshtml rename to test/WebSites/RazorWebSite/Views/NestedViewImports/Nested/_ViewImports.cshtml diff --git a/test/WebSites/RazorWebSite/Views/NestedGlobalImports/Nested/_ViewStart.cshtml b/test/WebSites/RazorWebSite/Views/NestedViewImports/Nested/_ViewStart.cshtml similarity index 100% rename from test/WebSites/RazorWebSite/Views/NestedGlobalImports/Nested/_ViewStart.cshtml rename to test/WebSites/RazorWebSite/Views/NestedViewImports/Nested/_ViewStart.cshtml diff --git a/test/WebSites/RazorWebSite/Views/NestedGlobalImports/_GlobalImport.cshtml b/test/WebSites/RazorWebSite/Views/NestedViewImports/_ViewImports.cshtml similarity index 100% rename from test/WebSites/RazorWebSite/Views/NestedGlobalImports/_GlobalImport.cshtml rename to test/WebSites/RazorWebSite/Views/NestedViewImports/_ViewImports.cshtml diff --git a/test/WebSites/RazorWebSite/Views/_GlobalImport.cshtml b/test/WebSites/RazorWebSite/Views/_ViewImports.cshtml similarity index 100% rename from test/WebSites/RazorWebSite/Views/_GlobalImport.cshtml rename to test/WebSites/RazorWebSite/Views/_ViewImports.cshtml diff --git a/test/WebSites/TagHelpersWebSite/Controllers/HomeController.cs b/test/WebSites/TagHelpersWebSite/Controllers/HomeController.cs index a4eccc76b4..3ee2955956 100644 --- a/test/WebSites/TagHelpersWebSite/Controllers/HomeController.cs +++ b/test/WebSites/TagHelpersWebSite/Controllers/HomeController.cs @@ -30,7 +30,7 @@ namespace TagHelpersWebSite.Controllers return View(); } - public ViewResult NestedGlobalImportTagHelper() + public ViewResult NestedViewImportsTagHelper() { return View(); } diff --git a/test/WebSites/TagHelpersWebSite/TagHelpers/NestedGlobalImportTagHelper.cs b/test/WebSites/TagHelpersWebSite/TagHelpers/NestedViewImportsTagHelper.cs similarity index 89% rename from test/WebSites/TagHelpersWebSite/TagHelpers/NestedGlobalImportTagHelper.cs rename to test/WebSites/TagHelpersWebSite/TagHelpers/NestedViewImportsTagHelper.cs index 6d191cfbff..91d2d860ee 100644 --- a/test/WebSites/TagHelpersWebSite/TagHelpers/NestedGlobalImportTagHelper.cs +++ b/test/WebSites/TagHelpersWebSite/TagHelpers/NestedViewImportsTagHelper.cs @@ -7,7 +7,7 @@ using Microsoft.AspNet.Razor.TagHelpers; namespace TagHelpersWebSite.TagHelpers { [TargetElement("nested")] - public class NestedGlobalImportTagHelper : TagHelper + public class NestedViewImportsTagHelper : TagHelper { public override void Process(TagHelperContext context, TagHelperOutput output) { diff --git a/test/WebSites/TagHelpersWebSite/Views/Home/NestedGlobalImportTagHelper.cshtml b/test/WebSites/TagHelpersWebSite/Views/Home/NestedViewImportsTagHelper.cshtml similarity index 100% rename from test/WebSites/TagHelpersWebSite/Views/Home/NestedGlobalImportTagHelper.cshtml rename to test/WebSites/TagHelpersWebSite/Views/Home/NestedViewImportsTagHelper.cshtml diff --git a/test/WebSites/TagHelpersWebSite/Views/Home/_GlobalImport.cshtml b/test/WebSites/TagHelpersWebSite/Views/Home/_GlobalImport.cshtml deleted file mode 100644 index e17878c5d8..0000000000 --- a/test/WebSites/TagHelpersWebSite/Views/Home/_GlobalImport.cshtml +++ /dev/null @@ -1 +0,0 @@ -@addTagHelper "TagHelpersWebSite.TagHelpers.NestedGlobalImportTagHelper, TagHelpersWebSite" diff --git a/test/WebSites/TagHelpersWebSite/Views/Home/_ViewImports.cshtml b/test/WebSites/TagHelpersWebSite/Views/Home/_ViewImports.cshtml new file mode 100644 index 0000000000..dba082f8b7 --- /dev/null +++ b/test/WebSites/TagHelpersWebSite/Views/Home/_ViewImports.cshtml @@ -0,0 +1 @@ +@addTagHelper "TagHelpersWebSite.TagHelpers.NestedViewImportsTagHelper, TagHelpersWebSite" diff --git a/test/WebSites/TagHelpersWebSite/Views/InheritedTagHelperPrefix/NestedInheritedTagHelperPrefix/_GlobalImport.cshtml b/test/WebSites/TagHelpersWebSite/Views/InheritedTagHelperPrefix/NestedInheritedTagHelperPrefix/_ViewImports.cshtml similarity index 100% rename from test/WebSites/TagHelpersWebSite/Views/InheritedTagHelperPrefix/NestedInheritedTagHelperPrefix/_GlobalImport.cshtml rename to test/WebSites/TagHelpersWebSite/Views/InheritedTagHelperPrefix/NestedInheritedTagHelperPrefix/_ViewImports.cshtml diff --git a/test/WebSites/TagHelpersWebSite/Views/InheritedTagHelperPrefix/_GlobalImport.cshtml b/test/WebSites/TagHelpersWebSite/Views/InheritedTagHelperPrefix/_ViewImports.cshtml similarity index 100% rename from test/WebSites/TagHelpersWebSite/Views/InheritedTagHelperPrefix/_GlobalImport.cshtml rename to test/WebSites/TagHelpersWebSite/Views/InheritedTagHelperPrefix/_ViewImports.cshtml diff --git a/test/WebSites/TagHelpersWebSite/Views/RemoveInheritedTagHelpers/_GlobalImport.cshtml b/test/WebSites/TagHelpersWebSite/Views/RemoveInheritedTagHelpers/_ViewImports.cshtml similarity index 50% rename from test/WebSites/TagHelpersWebSite/Views/RemoveInheritedTagHelpers/_GlobalImport.cshtml rename to test/WebSites/TagHelpersWebSite/Views/RemoveInheritedTagHelpers/_ViewImports.cshtml index cd3709a79f..4ef0b0cae3 100644 --- a/test/WebSites/TagHelpersWebSite/Views/RemoveInheritedTagHelpers/_GlobalImport.cshtml +++ b/test/WebSites/TagHelpersWebSite/Views/RemoveInheritedTagHelpers/_ViewImports.cshtml @@ -1,2 +1,2 @@ @removeTagHelper "TagHelpersWebSite.TagHelpers.RootViewStartTagHelper, TagHelpersWebSite" -@addTagHelper "TagHelpersWebSite.TagHelpers.NestedGlobalImportTagHelper, TagHelpersWebSite" +@addTagHelper "TagHelpersWebSite.TagHelpers.NestedViewImportsTagHelper, TagHelpersWebSite" diff --git a/test/WebSites/TagHelpersWebSite/Views/Shared/ViewWithLayoutAndNestedTagHelper.cshtml b/test/WebSites/TagHelpersWebSite/Views/Shared/ViewWithLayoutAndNestedTagHelper.cshtml index badf269931..a6c51c6159 100644 --- a/test/WebSites/TagHelpersWebSite/Views/Shared/ViewWithLayoutAndNestedTagHelper.cshtml +++ b/test/WebSites/TagHelpersWebSite/Views/Shared/ViewWithLayoutAndNestedTagHelper.cshtml @@ -1,5 +1,5 @@ @{ Layout = "~/Views/Shared/_LayoutWithRootTagHelper.cshtml"; } -@addTagHelper "TagHelpersWebSite.TagHelpers.NestedGlobalImportTagHelper, TagHelpersWebSite" +@addTagHelper "TagHelpersWebSite.TagHelpers.NestedViewImportsTagHelper, TagHelpersWebSite" some-content diff --git a/test/WebSites/TagHelpersWebSite/Views/_GlobalImport.cshtml b/test/WebSites/TagHelpersWebSite/Views/_ViewImports.cshtml similarity index 100% rename from test/WebSites/TagHelpersWebSite/Views/_GlobalImport.cshtml rename to test/WebSites/TagHelpersWebSite/Views/_ViewImports.cshtml diff --git a/test/WebSites/ViewComponentWebSite/Views/_GlobalImport.cshtml b/test/WebSites/ViewComponentWebSite/Views/_ViewImports.cshtml similarity index 100% rename from test/WebSites/ViewComponentWebSite/Views/_GlobalImport.cshtml rename to test/WebSites/ViewComponentWebSite/Views/_ViewImports.cshtml