문제

This is my code:

// This method is called only once to initialize service-wide policies.
public static void InitializeService(DataServiceConfiguration config)
{
    // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
    // Examples:
    config.SetServiceOperationAccessRule("getSMSs", ServiceOperationRights.All);
    config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
}
public IQueryable<SM> getSMSs()
{
    SelfServiceEntities db = new SelfServiceEntities();
    return from d in db.SMS select d;
}

I got this exception:

The given name 'getSMSs' was not found in the service operations.
도움이 되었습니까?

해결책

you need to define your method as service operation

[WebGet]
public IQueryable<SM> getSMSs()
{
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top