예제 #1
0
        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();
        }
예제 #2
0
        public HttpResponseMessage Get(string specificName)
        {
            Procedure proc = ProcedureFactory.GetRestProcedure("GET", _specificSchema, specificName);

            proc.LoadFromQuery(Request.GetQueryNameValuePairs());
            string Json = proc.ExecuteJson();

            return(ProcessProcedureResult(Json, proc));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }