// api/saft/ProductSales?vid=C0001&begin=2016-01-01&end=2017-01-01 // api/saft/CustomerSpentValue?vid=PT505678900_C&begin=2016-01-01&end=2017-01-01 // api/saft/AccountInRange?vid=11&begin=2016-01-01&end=2016-12-01 public HttpResponseMessage Get(string id, string vid, string begin, string end) { HttpResponseMessage response = null; string body = ""; switch (id) { case "ProductSales": body = MongoConnection.GetProductSales(vid, begin, end); break; case "CustomerSpentValue": body = MongoConnection.GetCustomerTotalSpent(vid, begin, end); break; } response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(body, Encoding.UTF8, "application/json"); return(response); }