public HttpResponseMessage GetAllOrders(string storeid) { ResponseStatus response = new ResponseStatus(); try { var data = _repository.GetAllOrders(Convert.ToInt32(storeid)); if (data.Count() > 0) { response.isSuccess = true; response.serverResponseTime = System.DateTime.Now; return(Request.CreateResponse(HttpStatusCode.OK, new { data, response })); } else { response.isSuccess = false; response.serverResponseTime = System.DateTime.Now; return(Request.CreateResponse(HttpStatusCode.BadRequest, new { response })); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Something Worng !", ex)); } }