2012-11-24 3 views
1

nullable int를 매개 변수로 사용하여 잘 컴파일하는 WCF 메서드가 있습니다. 그러나 다른 프로젝트에서 서비스를 참조 할 때 매개 변수로 일반 int가 필요합니다. 다른 stackoverflow 스레드를 읽는 것에서 그것은 nullable int 매개 변수를 가질 수있는 것으로 보이지만이를 구현하는 방법을 찾을 수는 없습니다. 다음과 같이nullable int 매개 변수에 대해 null을 허용하지 않는 WCF 메서드

내 코드는 다음과 같습니다

[ServiceContract] 
public interface IService 
{ 
    [OperationContract] 
    string CompletePayment(int paymentType, int? userId) 
} 


public class Service : IService 
{ 

    public string CompletePayment(int paymentType, int? userId) 
    { 
     return "it worked"; 
    }   
}   

답변

관련 문제