abpframework / abpframework/abp
Document ITypeFinder
@hikalkan is already working on this.
Since Jun 14, 2022.
- Dominant language
- C#
- Stars
- 14.4k
- Forks
- 3.7k
- Avg merge
- 15h 32m
- Merged PRs (30d)
- 106
Description
ITypeFinder can be used to discover types in the application, even before the dependency injection registration phase completed.
Example usage:
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var typeFinder = context.Services.GetSingletonInstance<ITypeFinder>();
foreach (var type in typeFinder.Types)
{
if (type.IsAssignableTo<Control>())
{
// do something...
}
}
}
After the dependency injection phase completed, you can inject ITypeFinder into any class.
ITypeFinder makes it easy to find all types of the application without manually searching all the assemblies. It also makes the assembly search only once, so it is optimized.
There is also IAssemblyFinder to get all assemblies in the application.
Note that assemblies and types are returned only for the assemblies with AbpModule classes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.