Unity offers supports 3 types of injection: Property, Constructor and Method Injection.
If you are prepared to trade Property and Method Injection for better performance... then continue reading. I will describe in simple steps how to disable Property and Method Injection.
Sadly you will need to comment out 4 lines from the Unity sources and recompile. I hope someday the Unity dev team provides the possibility to specify what types of injections your container should support upon container creation.
Step 1: UnityDefaultStrategiesExtension.cs
You need to comment out the following 4 lines:
Context.BuildPlanStrategies.AddNew
UnityBuildStage.Initialization);
Context.BuildPlanStrategies.AddNew
UnityBuildStage.Initialization);
Context.Policies.SetDefault
new DefaultUnityPropertySelectorPolicy());
Context.Policies.SetDefault
new DefaultUnityMethodSelectorPolicy());
0 comments:
Post a Comment
Post a comment