public void ServiceOperation_Verify_ToString() { var request = new SDataServiceOperationRequest(_service) { ResourceKind = "employees", OperationName = "getStats" }; var url = request.ToString(); Expect(url, Is.EqualTo("http://localhost:59213/sdata/aw/dynamic/-/employees/$service/getStats")); }
private AtomEntry CreateServiceRequest(SDataService service) { var request = new SDataServiceOperationRequest(service); request.ContractName = "test"; request.ResourceKind = "products"; request.OperationName = "computePrice"; // the above configuration generates http://sdata.acme.com/sdata/sageApp/test/-/products/$service/computePrice // now reconfigure and generate for globally for the entire contract request.ResourceKind = string.Empty; // the above configuration generates http://sdata.acme.com/sdata/sageApp/test/-/$service/computePrice // read the feed from the server return(request.Create()); }
private AtomEntry CreateServiceOperationAsync(SDataService service) { var request = new SDataServiceOperationRequest(service); request.ApplicationName = "sageApp"; request.ContractName = "test"; request.OperationName = "computePrice"; // the above configuration generates http://sdata.acme.com/sdata/sageApp/test/-/$service/computePrice // read the entry from the server var asyncRequest = request.CreateAsync(); ISyndicationResource result; // wait around until the response is ready do { var progress = asyncRequest.Progress; // report progress to the user } while ((result = asyncRequest.Refresh()) == null); return(result as AtomEntry); }