Why no private properties injection yet?

Nov 30, 2013 at 6:01 PM
Edited Nov 30, 2013 at 6:19 PM
I'm working with Unity for many years but even at this days it still doesn't have the ability to inject private members values, which seems lame as to me. You do have the DynamicMethodPropertySetterStrategy class and particulary the GetValidatedPropertySetter method that searches for the member's non private setter, which has a code comment that in future you may open this method for overriding to be able to return private members' setter method.

So why don`t make this method virtual instead of static to make your users life easier?
Nov 30, 2013 at 7:43 PM
Don't blame Unity for your bad design.
Nov 30, 2013 at 7:56 PM
Edited Nov 30, 2013 at 7:56 PM
@dotNETjunkie: Good try but missed. I'll decide by myself what is good and what is bad for me. I don't think that injecting private members when I don't want to make them publicly available is a bad design. Now you can auto-inject public members but for private ones you need to do that manually and I'm sure you do that as well (I mean assigning private members). That`s lame as it could be done by overriding just one method. Especially that they have a comment in code "we could consider opening this up for private property injection".