有什么方法可以发送 DataContract 中属性的摘要信息吗?
例如
[DataContract]
public class MyClass
{
/// <summary>
/// My Summary information
/// </summary>
[DataMember]
public int MyProperty {get;set;}
}
这可以提供给获得数据契约(Contract)的客户吗?我对此表示怀疑,只是希望有人知道我不知道的事情,这很有可能。 :)
最佳答案
看看WCFExtras在 CodePlex 上。我没有使用过它,但听起来它完全符合您的要求:
Adding WSDL Documentation from Source Code XML Comments
This extension allows you to add WSDL documentation (annotaiton) directly from XML comments in your source file. These comments will be published as part of the WSDL and are available for WSDL tools that know how to take advantage of them (e.g. Apache Axis wsdl2java and others). Release 2.0 also includes a client side WSDL importer that will turn those WSDL comments to XML comments in the generated proxy code.
关于wcf - 在 DataContract Serializer Metadata 中包含 XML 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3198911/