DataContractSerializer. Export metadata. Type Annotations

Please tell me, is it possible to automatically generate annotation for types / elements in the generated xsd file with comments?

from

/// <summary> /// Comment for myclass /// </summary> [DataContract] public class myclass { } 

to

 <xs:complexType name="myclass"> <xs:annotation> <xs:documentation> Comment for myclass </xs:documentation> </xs:annotation> </xs:complexType> 

or directly to an element:

 <xs:element name="myclass" type="tns:myclass" > <xs:annotation> <xs:documentation> Comment for myclass </xs:documentation> </xs:annotation> 
 </xs:element> 
+4
source share
1 answer

No, you canโ€™t. XML comments are not compiled into your code. So svcutil just does not have this information.

However, depending on your actual goals, you can try changing the WSDL and XSD services with the instructions in this article .

+4
source

Source: https://habr.com/ru/post/1393916/


All Articles