public string GetAllDepartments() { try { List <DepartmentViewModel> departmentList = Mapper.Map <List <Department>, List <DepartmentViewModel> >(_departmentBusiness.GetAllDetpartments()); return(JsonConvert.SerializeObject(new { Result = "OK", Records = departmentList })); } catch (Exception ex) { AppConstMessage cm = c.GetMessage(ex.Message); return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message })); } }