2012-06-06 2 views
0

나는 간단한 POCO 개체와 2 개의 변수 a와 b와 그 합을 만드는 방법을 포함하는 클래스를 포함하는 도메인 서비스 클래스를 가지고 있습니다.wcf ria 서비스 호출에 대한 쿼리

public class DomainService1 : DomainService 
    { 
     abc obj = new abc(10, 20); 
     public int sum1() 
     { 
      return (obj.a + obj.b); 

     } 

    } 
    public class abc { 
     public int a { get; set; } 
     public int b { get; set; } 


     public abc(int c, int d) 
     { 
      a = c; 
      d = b; 

     } 

     } 
} 

저는 배우고 싶습니다. 실버 라이트의 메인 페이지에서이 wcf ria 서비스를 어떻게 호출 할 수 있습니까?

당신은 실버 측면에서 서비스이 방법으로 호출 할 수 있습니다

답변

1

:

DomainService1 domainService = new DomainService1(); 
domainService.sum1((op) => 
{ 
    //op.Value has the result 
}, null); 

또는

DomainService1 domainService = new DomainService1(); 
domainService.sum1(Sum1Completed, null); 

(...) 

void Sum1Completed(InvokeOperation<int> op) 
{ 
    //op.Value has the result 
}