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