public HttpResponseMessage GetAllTargetGraph(TargetGetChart objTarget) { HttpResponseMessage message; try { // TargetDataAccessLayer dal = new TargetDataAccessLayer(); var dynObj = new { result = _target.GetAllTargetGraph(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", "GetAllTargetGraph"); } return(message); }