开发者

WCF Data Service and Castle Windsor

开发者 https://www.devze.com 2023-02-06 11:06 出处:网络
I am trying to use the Castle Windsor with WCF Data Service. I have created an Entity Data Model say \"Person\" and added a WCF Data Service called \"MyService.svc\". This is then exposed through ODat

I am trying to use the Castle Windsor with WCF Data Service. I have created an Entity Data Model say "Person" and added a WCF Data Service called "MyService.svc". This is then exposed through OData...

public class MyService: DataService<Person>
...

Now, the question is how do you go about resolving this using the Windsor Container after registering it? (I registered 开发者_StackOverflow社区it through Global.asax). So when you make a request such as "http://localhost/MyService.svc", How do I go about resolving "MyService" instance? How and where could I intercept to provide an instance from Windsor container?


Have a look at these links. You have to add a few classes to hook in to the service factory. These examples are for Unity but I easily modified them for Castle Windsor:

http://initializecomponent.blogspot.com/2008/06/integrating-unity-with-wcf.html http://initializecomponent.blogspot.com/2008/06/unity-wcf-and-iis.html

0

精彩评论

暂无评论...
验证码 换一张
取 消