From e69a4e541bb5ca7e785e2cf1a1bb5b39a383aea3 Mon Sep 17 00:00:00 2001 From: Drew Brasher Date: Tue, 25 Jun 2024 14:35:41 -0500 Subject: [PATCH] Added support for Razor Pages to the Dependency Injector. --- .../Services/DependencyInjector/DependencyInjector.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lombiq.Vsix.Orchard/Services/DependencyInjector/DependencyInjector.cs b/Lombiq.Vsix.Orchard/Services/DependencyInjector/DependencyInjector.cs index cbba2cf..bcb1c70 100644 --- a/Lombiq.Vsix.Orchard/Services/DependencyInjector/DependencyInjector.cs +++ b/Lombiq.Vsix.Orchard/Services/DependencyInjector/DependencyInjector.cs @@ -92,7 +92,8 @@ public string GetExpectedClassName(Document document) // We should never get an exception here. This is just to ensure we access DTE on the main thread and get // rid of the VSTHRD010 violation. Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); - return Path.GetFileNameWithoutExtension(document.FullName); + return Path.GetFileNameWithoutExtension(document.FullName) + .Replace(".cshtml", "Model"); // Handle Razor Pages } private static void GetCodeLines(DependencyInjectionContext context)