diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs index 0e4731b29f72..6a77ea1ac918 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectFileSystem.cs @@ -34,7 +34,7 @@ public FileProviderRazorProjectFileSystem(RuntimeCompilationFileProvider filePro public IFileProvider FileProvider => _fileProvider.FileProvider; - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); @@ -96,4 +96,4 @@ private static string JoinPath(string path1, string path2) return path1 + "/" + path2; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs index 8113e1d6d4f5..2098ef927ceb 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/PageDirectiveFeature.cs @@ -77,7 +77,7 @@ public override IEnumerable FindHierarchicalItems(string baseP return Enumerable.Empty(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs index 01e778ca9876..93b895980822 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/TestInfrastructure/VirtualRazorProjectFileSystem.cs @@ -18,7 +18,7 @@ public override IEnumerable EnumerateItems(string basePath) return directory?.EnumerateItems() ?? Enumerable.Empty(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); @@ -44,4 +44,4 @@ public void Add(RazorProjectItem projectItem) _root.AddFile(new FileNode(filePath, projectItem)); } } -} \ No newline at end of file +} diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectFileSystem.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectFileSystem.cs index de7f34f5cd71..a937894f903f 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectFileSystem.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorProjectFileSystem.cs @@ -16,7 +16,7 @@ public DefaultRazorProjectFileSystem(string root) { throw new ArgumentException(Resources.ArgumentCannotBeNullOrEmpty, nameof(root)); } - + Root = root.Replace('\\', '/').TrimEnd('/'); } @@ -61,7 +61,7 @@ public override RazorProjectItem GetItem(string path, string fileKind) return new DefaultRazorProjectItem("/", filePath, relativePhysicalPath, fileKind, new FileInfo(absolutePath), cssScope: null); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/EmptyProjectFileSystem.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/EmptyProjectFileSystem.cs index 50849709af97..be7ab2d2feae 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/EmptyProjectFileSystem.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/EmptyProjectFileSystem.cs @@ -15,7 +15,7 @@ public override IEnumerable EnumerateItems(string basePath) return Enumerable.Empty(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProject.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProject.cs index 164d59e142d1..159b06c8b85f 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProject.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorProject.cs @@ -28,7 +28,7 @@ public abstract class RazorProject /// /// The path. /// The . - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public abstract RazorProjectItem GetItem(string path); /// @@ -50,7 +50,7 @@ public abstract class RazorProject /// traverses to the project root. /// e.g. /// /Views/Home/View.cshtml -> [ /Views/Home/FileName.cshtml, /Views/FileName.cshtml, /FileName.cshtml ] - /// + /// /// Project items returned by this method have inferred FileKinds from their corresponding file paths. /// public IEnumerable FindHierarchicalItems(string path, string fileName) @@ -70,7 +70,7 @@ public IEnumerable FindHierarchicalItems(string path, string f /// traverses to the . /// e.g. /// (/Views, /Views/Home/View.cshtml) -> [ /Views/Home/FileName.cshtml, /Views/FileName.cshtml ] - /// + /// /// Project items returned by this method have inferred FileKinds from their corresponding file paths. /// public virtual IEnumerable FindHierarchicalItems(string basePath, string path, string fileName) diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/VirtualRazorProjectFileSystem.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/VirtualRazorProjectFileSystem.cs index c6bf87efb0db..c46e0dc4fb7f 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/VirtualRazorProjectFileSystem.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/VirtualRazorProjectFileSystem.cs @@ -19,7 +19,7 @@ public override IEnumerable EnumerateItems(string basePath) return directory?.EnumerateItems() ?? Enumerable.Empty(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestRazorProject.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestRazorProject.cs index 1c4faa7b5b81..1bb1e13ad303 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestRazorProject.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/TestRazorProject.cs @@ -26,7 +26,7 @@ public override IEnumerable EnumerateItems(string basePath) throw new NotImplementedException(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/CompositeRazorProjectFileSystem.cs b/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/CompositeRazorProjectFileSystem.cs index 092851d31108..a3d4fc71654b 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/CompositeRazorProjectFileSystem.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Tools/src/CompositeRazorProjectFileSystem.cs @@ -27,7 +27,7 @@ public override IEnumerable EnumerateItems(string basePath) } } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectFileSystem.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectFileSystem.cs index ed8383a9f5b2..271c6224372d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectFileSystem.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/TestRazorProjectFileSystem.cs @@ -28,7 +28,7 @@ public override IEnumerable EnumerateItems(string basePath) throw new NotImplementedException(); } - [Obsolete("Use GetItem(string path, string fileKind) instead.")] + public override RazorProjectItem GetItem(string path) { return GetItem(path, fileKind: null);