2010-03-10 2 views

답변

7

예 WCF RIA 서비스는 사용자 지정 방법을 지원할 수 있습니다.

사용자 지정 메서드를 [Invoke] 특성으로 지정하도록 지정합니다. EG는 :

[EnableClientAccess()] 
public class TestDomainService : LinqToEntitiesDomainService<TestEntities> 
{ 
    [Invoke] 
    public Test CustomMethodFetch(Guid testId) 
    { 
    ... 
    return foundTest; 
    } 
} 

.. 당신은에 의해 호출 것 ...

var ctx = new TestDomainContext(); 

ctx.CustomMethodFetch(testId, (op) => 
{ 
    if (op.HasError) 
    // Handle errors. 
    else 
    { 
    var testEntity = op.Value; 
    // Do stuff. 
    } 
}); 
관련 문제