public HttpResponseMessage GetAllTargetforGrid(TargetGetChart objTarget) { HttpResponseMessage message; try { // TargetDataAccessLayer dal = new TargetDataAccessLayer(); var dynObj = new { result = _target.GetAllTargetCumulitive(objTarget) }; message = Request.CreateResponse(HttpStatusCode.OK, dynObj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = " Somthing wrong,try Again!" }); ErrorLog.CreateErrorMessage(ex, "Target", "GetAllTargetforGrid"); } return(message); }