开发者

WCF: Extract service-methods into classes

开发者 https://www.devze.com 2023-03-23 11:35 出处:网络
the normal way in wcf is to define all methods in the service-class. [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

the normal way in wcf is to define all methods in the service-class.

[ServiceContract]
   [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
   [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]

   public class RestService
   {
      [WebGet(UriTemplate = "/uriTemplate", ResponseFormat = WebMessageFormat.Json)]
      public Stream GetSomething()
      {
          ...
      }
   }

Is it possible to extract these methodes into classes and put these classes into the r开发者_高级运维oot-service-class?

0

精彩评论

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