public void PostOrder1() { string Json = "{'personId': 1, 'orderName': 'my first order', 'orderItems': [{'name': 'pizza', 'comments': 'Extra Cheese Please'},{'name': 'italian sandwich', 'comments': 'No peppers'}]}"; Procedure procedure = ProcedureFactory.GetRestProcedure("POST", "trusted", "ORDER"); procedure.LoadFromJson(Json); string result = procedure.ExecuteJson(); }
public HttpResponseMessage Get(string specificName) { Procedure proc = ProcedureFactory.GetRestProcedure("GET", _specificSchema, specificName); proc.LoadFromQuery(Request.GetQueryNameValuePairs()); string Json = proc.ExecuteJson(); return(ProcessProcedureResult(Json, proc)); }
public async Task <HttpResponseMessage> Delete(string specificName) { string requestJson = await Request.Content.ReadAsStringAsync(); Procedure proc = ProcedureFactory.GetRestProcedure("DELETE", _specificSchema, specificName); proc.LoadFromJson(requestJson); proc.ExecuteNonQuery(); return(ProcessProcedureResult(null, proc)); }
public async Task <HttpResponseMessage> Put(string specificName) { string requestJson = await Request.Content.ReadAsStringAsync(); Procedure proc = ProcedureFactory.GetRestProcedure("PUT", _specificSchema, specificName); proc.LoadFromJson(requestJson); string Json = proc.ExecuteJson(); return(ProcessProcedureResult(Json, proc)); }