public List <JobIndustryAreaViewModel> GetCategory() { DataTable dt = _homeRepositories.GetCategory(); if (dt.Rows.Count > 0) { List <JobIndustryAreaViewModel> lstJobCategory = new List <JobIndustryAreaViewModel>(); for (int i = 0; i < dt.Rows.Count; i++) { JobIndustryAreaViewModel jobCategory = new JobIndustryAreaViewModel { JobIndustryAreaId = Convert.ToInt32(dt.Rows[i]["JobIndustryAreaId"]), JobIndustryAreaName = Convert.ToString(dt.Rows[i]["JobIndustryAreaName"]) }; lstJobCategory.Add(jobCategory); } return(lstJobCategory); } throw new DataNotFound("Data not found"); }