コード例 #1
0
 public ActionResult GetCustomer([ProtoPost] GetCustomerRequest req)
 {
     // create a response
     var resp = new GetCustomerResponse {
         cust = new Customer {
             id = req.id,
             name = "Name of cust " + req.id,
             address = new Address {
                 line1 = "27 wood lane", zip = "pl1"
             }
         }
     };
     return new ProtoResult(resp);
 }
コード例 #2
0
        public override object Execute(HttpContext context, object request) {
            // inspect the incoming request
            var req = (GetCustomerRequest)request;

            // create a response
            var resp = new GetCustomerResponse {
                cust = new Customer {
                    id = req.id,
                    name = "Name of cust " + req.id,
                    address = new Address {
                        line1 = "27 wood lane", zip = "pl1"
                    }
                }
            };
            return resp;
        }