https://github.com/shuttle/shuttle.core.reflection
Reflection infrastructure components.
https://github.com/shuttle/shuttle.core.reflection
Last synced: about 1 month ago
JSON representation
Reflection infrastructure components.
- Host: GitHub
- URL: https://github.com/shuttle/shuttle.core.reflection
- Owner: Shuttle
- License: bsd-3-clause
- Created: 2017-12-27T20:06:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T11:06:49.000Z (about 1 year ago)
- Last Synced: 2024-10-05T11:15:19.462Z (8 months ago)
- Language: C#
- Size: 104 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shuttle.Core.Reflection
```
PM> Install-Package Shuttle.Core.Reflection
```Provides various methods to facilitate reflection handling.
## ReflectionService
``` c#
Task> GetMatchingAssembliesAsync(Regex regex)
```Returns a collection of assemblies that have their file name matching the given `Regex` expression.
``` c#
Task> GetRuntimeAssembliesAsync()
```Returns a combination of `DependencyContext.Default.GetRuntimeAssemblyNames(Environment.OSVersion.Platform.ToString())` and `AppDomain.CurrentDomain.GetAssemblies()`.
``` c#
Task GetTypeAsync(string typeName)
```Attempts to find the requested type.
``` c#
Task> GetTypesCastableToAsync(Type type, Assembly assembly)
// and these extensions
Task> GetTypesCastableToAsync();
Task> GetTypesCastableToAsync(Type type);
Task> GetTypesCastableToAsync(Assembly assembly);
```Returns all the types in the given `assembly` that can be cast to the `type` or `typeof(T)`; if no `assembly` is provided the all assemblies returned by `GetAssembliesAsync()` will be scanned.