WCF REST: remove prefix “ArrayOf” for wcf method response

后端 未结 1 931
[愿得一人]
[愿得一人] 2020-12-15 12:47

Here is one of the methods from my wcf rest service:

    [OperationContract]
    [WebInvoke(UriTemplate = \"getInvoices\", Method = \"POST\", RequestFormat =         


        
相关标签:
1条回答
  • 2020-12-15 13:37

    You will need to implement custom collection derived from List<InvoiceRet> and mark it with CollectionDataContractAttribute:

    [CollectionDataContract]
    public class ListInvoice : List<InvoiceRet>
    { }
    

    Use this collection as return type from your operation. Here is full description of using collections in data contracts.

    0 讨论(0)
提交回复
热议问题