Add extra check (#12075)

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
This commit is contained in:
Nikolaj Geisle
2022-03-02 08:47:35 +01:00
committed by GitHub
parent 0c7ef06031
commit 44ddf7acef

View File

@@ -24,7 +24,7 @@ namespace Umbraco.Extensions
/// <returns></returns>
public static string GetControllerName(Type controllerType)
{
if (!controllerType.Name.EndsWith("Controller"))
if (!controllerType.Name.EndsWith("Controller") && !controllerType.Name.EndsWith("Controller`1"))
{
throw new InvalidOperationException("The controller type " + controllerType + " does not follow conventions, MVC Controller class names must be suffixed with the term 'Controller'");
}