diff --git a/src/Mvc/Mvc.Razor/src/ApplicationParts/ConsolidatedAssemblyApplicationPartFactory.cs b/src/Mvc/Mvc.Razor/src/ApplicationParts/ConsolidatedAssemblyApplicationPartFactory.cs new file mode 100644 index 000000000000..774d6ae75a3e --- /dev/null +++ b/src/Mvc/Mvc.Razor/src/ApplicationParts/ConsolidatedAssemblyApplicationPartFactory.cs @@ -0,0 +1,28 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace Microsoft.AspNetCore.Mvc.ApplicationParts +{ + /// + /// Configures an that contains controllers, as well as Razor views and Pages. + /// + /// Combines the results of and + /// . This part factory + /// may be used if Razor views or Razor Pages are compiled in to with other types including controllers. + /// + /// + public sealed class ConsolidatedAssemblyApplicationPartFactory : ApplicationPartFactory + { + /// + public override IEnumerable GetApplicationParts(Assembly assembly) + { + return Enumerable.Concat( + DefaultApplicationPartFactory.GetDefaultApplicationParts(assembly), + CompiledRazorAssemblyApplicationPartFactory.GetDefaultApplicationParts(assembly)); + } + } +} diff --git a/src/Mvc/Mvc.Razor/src/PublicAPI.Unshipped.txt b/src/Mvc/Mvc.Razor/src/PublicAPI.Unshipped.txt index 7dc5c58110bf..59bcc0faaa4f 100644 --- a/src/Mvc/Mvc.Razor/src/PublicAPI.Unshipped.txt +++ b/src/Mvc/Mvc.Razor/src/PublicAPI.Unshipped.txt @@ -1 +1,4 @@ #nullable enable +Microsoft.AspNetCore.Mvc.ApplicationParts.ConsolidatedAssemblyApplicationPartFactory +Microsoft.AspNetCore.Mvc.ApplicationParts.ConsolidatedAssemblyApplicationPartFactory.ConsolidatedAssemblyApplicationPartFactory() -> void +~override Microsoft.AspNetCore.Mvc.ApplicationParts.ConsolidatedAssemblyApplicationPartFactory.GetApplicationParts(System.Reflection.Assembly assembly) -> System.Collections.Generic.IEnumerable