tag:blogger.com,1999:blog-4045671445828312434.post7343452144472502542..comments2024-03-25T15:11:30.341+05:30Comments on Born to Automate : Dependency injection – Auto registration in UnityPrajeesh Prathaphttp://www.blogger.com/profile/10973885615112785714noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-4045671445828312434.post-24195681423585545802012-03-29T18:41:00.139+05:302012-03-29T18:41:00.139+05:30Hi again.
I think I've found a bug in the The...Hi again.<br /><br />I think I've found a bug in the Then.Register.Interfaces property - I get a Null reference error on the property getter. It seems like every time I evaluate it. I'd be happy to fix this myself if the code's available for this, If not, I'd appreciate a fix so I can use it! :)<br /><br />I am trying to register another container extension automatically at the same time as I register the type, so trying to access Interfaces for that purpose.<br /><br />Thanks,<br />RichUnknownhttps://www.blogger.com/profile/03448037004078889260noreply@blogger.comtag:blogger.com,1999:blog-4045671445828312434.post-43107204822952685312012-03-29T17:00:25.382+05:302012-03-29T17:00:25.382+05:30This is a brilliant extension, thanks! Using it t...This is a brilliant extension, thanks! Using it to run through the Modules directory accessed by my bootstrapper and register all my View/Viewmodel types to specific interfaces.<br /><br />A couple of questions: <br />1) How does your code define "FirstInterfaceOfType". Is it the first one applied in code to this class directly? <br /><br />Example: <br />ViewModelBase implements IViewModelBase<br />XXXViewModel inherits ViewModelBase<br />Implements IXXXViewModel<br />IXXXViewModel inherits IViewModelBase<br /><br />If I autoregister XXXViewModelBase AsFirstInstanceOfType, will I get IViewModelBase or IXXXViewModel?<br /><br />2) Is there a way to combine As(Of X) with a name?<br /><br />That's all! Thanks again!<br />RichUnknownhttps://www.blogger.com/profile/03448037004078889260noreply@blogger.com