Merge pull request #1501 from Gotiap/dev

Allowed pages for external modules.
This commit is contained in:
Shaun Walker 2021-06-24 07:37:49 -04:00 committed by GitHub
commit 7fa30ff23c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,10 @@
using System;
using System;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Oqtane.Infrastructure;
using Microsoft.AspNetCore.Mvc.RazorPages;
// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection
@ -22,7 +23,7 @@ namespace Microsoft.Extensions.DependencyInjection
foreach (var assembly in assemblies)
{
// check if assembly contains MVC Controllers
if (assembly.GetTypes().Any(t => t.IsSubclassOf(typeof(Controller))))
if (assembly.GetTypes().Any(t => t.IsSubclassOf(typeof(Controller)) || t.IsSubclassOf(typeof(Page))))
{
var partFactory = ApplicationPartFactory.GetApplicationPartFactory(assembly);
foreach (var part in partFactory.GetApplicationParts(assembly))