-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add findAssemblies for discovering types
- Loading branch information
1 parent
5077c60
commit bfd5ceb
Showing
5 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
PiBox.Hosting/Abstractions/src/PiBox.Hosting.Abstractions/Extensions/AssemblyExtensions.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Reflection; | ||
|
||
namespace PiBox.Hosting.Abstractions.Extensions | ||
{ | ||
public static class AssemblyExtensions | ||
{ | ||
public static bool HasType(this Assembly assembly, Predicate<Type> typePredicate) | ||
{ | ||
return assembly.GetTypes().Any(t => typePredicate(t)); | ||
} | ||
} | ||
} |
This file contains 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
3 changes: 3 additions & 0 deletions
3
...x.Hosting/Abstractions/src/PiBox.Hosting.Abstractions/Services/IImplementationResolver.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
using System.Reflection; | ||
|
||
namespace PiBox.Hosting.Abstractions.Services | ||
{ | ||
public interface IImplementationResolver | ||
{ | ||
void ClearInstances(); | ||
object ResolveInstance(Type type); | ||
List<Type> FindTypes(); | ||
List<Assembly> FindAssemblies(); | ||
} | ||
} |
This file contains 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
This file contains 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