Why would a WCF method's return type be changed from a generic collection to an array?

前端 未结 4 1555
一整个雨季
一整个雨季 2021-01-21 13:23

I have a WCF service method which I have written for return type as collection type.

But if I generate a proxy class and consume the method from the client the methods r

4条回答
  •  甜味超标
    2021-01-21 13:46

    You need to tell svcutil to generate the types as whatever generic type you want. You do this by adding this switch to the svcutil command:

    svcutil ..blah... /ct:System.Collections.ObjectModel.Collection`1
    

    The /ct is short for /collectionType. In this case I specified Collection but you could have just as easily used System.Collections.Generic.List.

提交回复
热议问题