public List <SearchJobListViewModel> GetFeaturedJobs() { DataTable dt = _homeRepositories.GetFeaturedJobs(); List <SearchJobListViewModel> lstfeautredJobs = new List <SearchJobListViewModel>(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { SearchJobListViewModel feautredJob = new SearchJobListViewModel { CompanyLogo = Convert.ToString(dt.Rows[i]["CompanyLogo"]) ?? "", JobTitle = Convert.ToString(dt.Rows[i]["JobTitle"]) ?? "", EmploymentStatus = Convert.ToString(dt.Rows[i]["EmploymentStatus"]) ?? "", City = Convert.ToString(dt.Rows[i]["City"]) ?? "", HiringCriteria = Convert.ToString(dt.Rows[i]["HiringCriteria"]) ?? "", CompanyName = Convert.ToString(dt.Rows[i]["CompanyName"]) ?? "", JobPostId = (dt.Rows[i]["JobPostId"] as int?) ?? 0, JobTitleByEmployer = Convert.ToString(dt.Rows[i]["JobTitleByEmployer"]) ?? "", FeaturedJobDisplayOrder = (dt.Rows[i]["FeaturedJobDisplayOrder"] as int?) ?? 0, JobDetails = Convert.ToString(dt.Rows[i]["JobDetails"]) ?? "", CTC = Convert.ToString(dt.Rows[i]["CTC"]) ?? "", NumberOfDays = Convert.ToString(dt.Rows[i]["NumberOfDays"]) ?? "" }; lstfeautredJobs.Add(feautredJob); } } return(lstfeautredJobs); }