Skip to content

Commit

Permalink
Added support for Razor Pages to the Dependency Injector.
Browse files Browse the repository at this point in the history
  • Loading branch information
DrewBrasher committed Jun 25, 2024
1 parent 2a82482 commit e69a4e5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e69a4e5

Please sign in to comment.