Does MS PnP Unity Scan for Assemblies Like StructureMap?

旧城冷巷雨未停 提交于 2019-12-02 04:11:49

The Assembly Matching Rule is used for applying interception to classes constructed by Unity and not for container registration. Unity itself does not have any convention-based scanning functionality like StructureMap. There is a CodePlex project that adds similar functionality to Unity though. http://autoregistration.codeplex.com/

Registration by Convention was added in Unity 3.0. Nice examples of this feature are provided in "Developer's Guide to Dependency Injection Using Unity" in solution in samples named OtherUnitySamples. You can find the book here:

http://msdn.microsoft.com/en-us/library/dn178463(v=pandp.30).aspx

and code samples here:

unity.codeplex.com/downloads/get/683531

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!