Can a WCF service contract have a nullable input parameter?

前端 未结 4 1551
-上瘾入骨i
-上瘾入骨i 2021-02-03 10:13

I have a contract defined like this:

[OperationContract]
[WebGet(UriTemplate = \"/GetX?myStr={myStr}&myX={myX}\", BodyStyle = WebMessageBodyStyle.Wrapped)]
s         


        
4条回答
  •  离开以前
    2021-02-03 10:49

    Actually...you absolutely can have nullable parameters, or any other type of parameter that isn't supported by QueryStringConverter out of the box. All you need to do is extend QueryStringConverter to support any type you would need. See the accepted answer in this post ==>

    In the WCF web programming model, how can one write an operation contract with an array of query string parameters (i.e. with the same name)?

提交回复
热议问题