Beispiel #1
0
        public IHttpActionResult GetSaleOrder(string order, string orderBy)
        {
            var salesList = SaleServices.GetSaleOrder(order.Trim(), orderBy.Trim());

            HttpContext.Current.Response.AppendHeader("API-Version", apiVersion);
            HttpContext.Current.Response.AppendHeader("Response-Type", "JSON");
            HttpContext.Current.Response.AppendHeader("Response-Object-Length", salesList.Count.ToString() + " Items");
            HttpContext.Current.Response.AppendHeader("List-URL", Request.RequestUri.AbsoluteUri);

            JsonSerializerSettings serializerSettings = new JsonSerializerSettings {
                Formatting = Formatting.Indented
            };

            return(Json(salesList, serializerSettings));
        }