Created
February 22, 2016 13:35
-
-
Save brainwipe/2a925070dc4f64b0a4b1 to your computer and use it in GitHub Desktop.
Find all loaded types in ASP.NET Core, C# snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prior to ASP.NET Core, you had access to the AppDomain and all the loaded assemblies. | |
using Microsoft.AspNet.Mvc.Infrastructure; | |
using Microsoft.Extensions.PlatformAbstractions; | |
// Snip... | |
var assemblyProvider = new DefaultAssemblyProvider(PlatformServices.Default.LibraryManager); | |
var resourceControllers = assemblyProvider.CandidateAssemblies | |
.SelectMany(x => x.DefinedTypes) | |
.ToList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment