public IActionResult Get(JObject data) { Customer customer = JsonConvert.DeserializeObject <Customer>(data.ToString()); List <Order> queryResult = OrderUtils.QueryOrder((order) => { return(CustomerUtils.CompareCustomer(order.customer, customer)); }); return(queryResult.Count >= 1 ? (ActionResult) new OkObjectResult(JsonConvert.SerializeObject(queryResult, Formatting.Indented)) : new BadRequestObjectResult("No result found")); }