Created
March 20, 2017 14:49
-
-
Save surgicalcoder/11897ac73354c58255fda4d13a28d5a2 to your computer and use it in GitHub Desktop.
Hack for adding MVC Core modules dynamically
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
| public class Blarg : ApplicationPart, IApplicationPartTypeProvider, ICompilationReferencesProvider | |
| { | |
| public Assembly Assembly { get; } | |
| public Blarg(Assembly assembly) | |
| { | |
| if (assembly == (Assembly)null) | |
| throw new ArgumentNullException("assembly"); | |
| this.Assembly = assembly; | |
| } | |
| public override string Name | |
| { | |
| get | |
| { | |
| return this.Assembly.GetName().Name; | |
| } | |
| } | |
| /// <inheritdoc /> | |
| public IEnumerable<TypeInfo> Types | |
| { | |
| get | |
| { | |
| return this.Assembly.DefinedTypes; | |
| } | |
| } | |
| public IEnumerable<string> GetReferencePaths() | |
| { | |
| return Enumerable.Empty<string>(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment