Merge pull request #1501 from Gotiap/dev
Allowed pages for external modules.
This commit is contained in:
commit
7fa30ff23c
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user