In Micro Focus managed Cobol, how can we set value of a method attribute? Viz. In C# we do

[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json)]
public override string[] Method

So in Cobol we declare the method as

method-id MethodName public 
     attribute OperationContractAttribute
     attribute WebGetAttribute.

But how do we set ResponseFormat = WebMessageFormat.Json ?

有帮助吗?

解决方案

Similar (but not identical) to C#. The biggest difference is that the keyword 'property' has to be used before the property name.

method-id MethodName public 
    attribute OperationContractAttribute
    attribute WebGetAttribute(property ResponseFormat = type WebMessageFormat::Json).
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top