Can't use optional parameters when implementing an interface for a WCF

后端 未结 5 780
刺人心
刺人心 2021-01-11 10:19

In my interface I have declared this.

[OperationContract]
[WebGet]
String GetStuff(String beep, String boop = \"too lazy to type\");

I impl

5条回答
  •  一整个雨季
    2021-01-11 10:44

    Simply: default arguments are not supported.

    By design and with reason. We use C# to write WCF contracts but that's a notational trick. Not every C# language feature can be implemented in SOAP, REST or JSon.

提交回复
热议问题