Comments (2)
What is this doing that the existing AutoRegister doesn't already do?
As for it being accessible, it's an internal concern of the container, but the main container class is intentionally a partial class to allow for extensions like this without touching the main cs file, so if you create another partial with the method you want it will be able to access the private _RegisteredTypes field.
from tinyioc.
What is this doing that the existing AutoRegister doesn't already do?
- It doesn't leave the existing registrations untouched.
- The registration rules are very specific, and I don't see how to implemenet all of them using the existing
AutoRegister
methods. These are the rules:- It should only look at the assemblies loaded into the current appdomain.
- There are some assemblies of the current appdomain that should be ignored.
- It should only register interfaces as keys (no concrete types, no abstract classes).
- It sould only register interfaces as keys that are not declared in the ignored assemblies even if the found concrete implementations are declared outside the ingored assemblies.
- If multiple concrete implementations are found, it should use
RegisterMultiple
.
Thanks for the tip with the partial
classes. So I could easily implement this:
public partial class TinyIoCContainer
{
/// <summary>
/// Gets all types that are registered as keys with this container.
/// </summary>
public IEnumerable<Type> RegisterdTypes
{
get
{
return this._RegisteredTypes.Keys.Select(rt => rt.Type).Distinct();
}
}
}
from tinyioc.
Related Issues (20)
- Unnecessary SuppressFinalizes HOT 3
- Platform compatibility HOT 7
- Resolving generic type from parent container fails HOT 3
- Injecting IEnumerable<Type> to constructor - unnamed registrations HOT 1
- System.IO.FileNotFoundException with UWP and TinyIoC 1.3.0 HOT 6
- It would be nice to have a .NET Core test app HOT 1
- NuGet Support & Build System HOT 4
- Resolve Issues with 1.4 alpha nuget packages HOT 10
- AutoRegister registers over 10k types when using in Xamarin.Forms HOT 4
- The type.gettypeconStructors method gets seven constructors in .Net Core HOT 3
- QUESTION: Can I disable property injection? HOT 2
- Registering Xamarin.Essentials.Interface HOT 10
- TinyIoC namespace cannot be found HOT 1
- PublishAsync publishes message twice (.netstandard)
- Optimization of objects allocation during auto-registration of TinyIoC HOT 3
- Is this good choice for large scale ASP.NET projects? HOT 1
- TinyIoCResolutionException after multiple calls of AutoRegister
- Should nullable reference types be supported, or have their code analysis warnings disabled inside the file via pragma's? HOT 4
- [.net-ios] Warning : The file 'TinyIoc.cs' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. HOT 1
- Registering any class with a copy constructor throws a System.TypeInitializationException HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyioc.