문제

i am creating my first wcf service with webHttpBinding. On the net, i have read lot of articled telling that its bad practice to use out parameters with web services as described in

Is it bad practice to have an output parameter in a method in a WCF service?
Sometimes if we use out parameters in SOAP scenario. The client definition generated from wsdl changes the order of parameters as discussed here http://social.msdn.microsoft.com/Forums/en/wcf/thread/48b5992f-f7bd-4b67-8299-514d1780fa9a
what i have come to believe is that out parameters are impossible to work with in REST (webHttpBinding). Can anyone confirm or deny this?

도움이 되었습니까?

해결책

it's a bad practice to use out parameters at all in code. It makes code less readable and more error prone. You should always think about creating a returning object if you need more than 1 parameter back from a method. (in c# 4 you also can choose to return a tuple).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top