Need complete DI sample for WCF

落爺英雄遲暮 提交于 2019-12-14 03:44:11

问题


Does anyone have a complete and working DI sample for WCF?

Every sample I find just gets me more confused. Does anyone know of a complete and working standalone simple sample that works with the built in stuff?

Maybe once I get a handle of the built in stuff, I can move on to different DI frameworks such as StructureMap or Unity with WCF.

My MVC project is currently using Unity for all its DI.


回答1:


The code download for my book Dependency Injection in .NET contains a full, working example.

However, most of what you'll need to know is explained in this answer: Injecting data to a WCF service




回答2:


I recommend this one. I have already used it and it is fully working.




回答3:


This one is the most straightforward one I've found.




回答4:


DI with Castle Windsor

  • Official Site http://docs.castleproject.org/Windsor.WCF-Integration-Facility.ashx
  • Blog article http://ayende.com/blog/2548/wcf-windsor-integration
  • Blog article with sample http://mikehadlow.blogspot.com/2008/11/windsor-wcf-integration.html



回答5:


There is a fully working downloadable sample here on Codeplex. It uses the Unity.WCF NuGet package, so it's really the kind of slam dunk example you are looking for.



来源:https://stackoverflow.com/questions/5255344/need-complete-di-sample-for-wcf

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