Add ServiceCollection extensions for Oqtane
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.ApplicationParts;
|
||||
@ -9,10 +7,10 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
{
|
||||
public static class MvcModuleExtensions
|
||||
{
|
||||
public static IMvcBuilder AddModuleAssemblies(this IMvcBuilder mvcBuilder, List<Assembly> assemblies)
|
||||
public static IMvcBuilder AddOqtaneApplicationParts(this IMvcBuilder mvcBuilder)
|
||||
{
|
||||
// load MVC application parts from module assemblies
|
||||
foreach (Assembly assembly in assemblies)
|
||||
foreach (Assembly assembly in OqtaneServiceCollectionExtensions.GetOqtaneModuleAssemblies())
|
||||
{
|
||||
// check if assembly contains MVC Controllers
|
||||
if (assembly.GetTypes().Where(item => item.IsSubclassOf(typeof(Controller))).ToArray().Length > 0)
|
||||
|
Reference in New Issue
Block a user