I have a custom WCF RIA Service query that accepts one parameter. I can access the method via URI by calling:
/WCF_RIA_ServiceData.svc/GetJobDataByEmployee
but because my query is dependant upon the parameter being passed, nothing is returned. I have tried to pass the parameter(int) multiple ways:
/WCF_RIA_ServiceData.svc/GetJobDataByEmployee(1)
/WCF_RIA_ServiceData.svc/GetJobDataByEmployee/1
/WCF_RIA_ServiceData.svc/1/GetJobDataByEmployee/
/WCF_RIA_ServiceData.svc/GetJobDataByEmployee?EmployeeID=1/
/WCF_RIA_ServiceData.svc/GetJobDataByEmployee?1/
All of which fail. Can someone please let me know how to call the method with a parameter? Thank you for any info!
I have figured it out.
/WCF_RIA_ServiceData.svc/GetJobDataByEmployee?EmployeeID=1/
is the correct way to call it, but you have to specify that it has side-effects by adding this line before your method in the WCF RIA Service.
[Query(HasSideEffects = true)]
I don't quite understand why this is required, because in my case the code doesn't actually cause any side-effects. If anyone has any information on why this is required please let me know.