日期:2014-05-17  浏览次数:21151 次

WCF方法注释
服务器端方法

/// <summary>
        /// Hello
        /// </summary>
        /// <param name="YourName"></param>
        /// <returns></returns>
        [OperationContract]
        string Hello(string YourName);

客户端在引用后
[System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class Service1Client : System.ServiceModel.ClientBase<ConsoleApplication4.ServiceReference1.IService1>, ConsoleApplication4.ServiceReference1.IService1 {
        
        public Service1Client() {
        }
        
        public Service1Client(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public Service1Client(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Service1Client(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }
        
        public string Hello(string YourName) {
            return base.Channel.Hello(YourName);
        }

    }
这个方法 没有注释客户端看不到注释
还有就是服务器端的实体类
[DataContract]
    class Help
    {
        /// <summary>
        /// 消息
        /// </summary>
        [DataMember]
        public string Message { get; set; }
   &nb