2010-04-29 2 views
3

방금 ​​"Injecting Custom Logic in ADO.NET Data Services"을 읽었습니다. 다음 질문은 어떻게 클라이언트 측 프록시 클래스에 [WebGet] 메서드를 표시합니까? 물론, 이것을 WebClient과 직접 (RESTful) 호출 할 수는 있지만 ADO.NET 데이터 서비스의 강력한 입력 기능이 나를 자동으로 "숨길"것이라고 생각했습니다.ADO.NET 데이터 서비스의 사용자 지정 논리 및 프록시 클래스

그래서 여기에 우리가 있습니다

public class MyService : DataService<MyDataSource> 
{ 
    // This method is called only once to initialize service-wide policies. 
    public static void InitializeService(IDataServiceConfiguration config) 
    { 
     config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead); 
     config.SetServiceOperationAccessRule("CustomersInCity", ServiceOperationRights.All); 
    } 

    [WebGet] 
    public IQueryable<MyDataSource.Customers> CustomersInCity(string city) 
    { 
     return from c in this.CurrentDataSource.Customers 
       where c.City == city 
       select c; 
    } 

} 

가 어떻게 내 클라이언트 측 클래스되어 정의에 표시 할 CustomersInCity()을받을 수 있나요?

+0

당신이 하나로, OData 때와 수 있다고 생각하지 않습니다 ... 그것은 같은 것을하게 될 방법에 대한 링크 후 메소드 이름을 쓰기 이 서비스에서 WSDL 끝점이 올바르게 비활성화되어 있습니다. –

답변

관련 문제