public List <TopEmployerViewModel> TopEmployer() { DataTable dt = _homeRepositories.TopEmployer(); List <TopEmployerViewModel> lstTopEmployer = new List <TopEmployerViewModel>(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { TopEmployerViewModel topEmployer = new TopEmployerViewModel { CompanyName = Convert.ToString(dt.Rows[i]["CompanyName"]), UserId = Convert.ToInt32(dt.Rows[i]["UserId"]), Logo = Convert.ToString(dt.Rows[i]["Logo"]), JobseekerId = Convert.ToInt32(dt.Rows[i]["JobSeekerID"]), Count = Convert.ToInt32(dt.Rows[i]["Count"]), FollowIsActive = Convert.ToInt32(dt.Rows[i]["FollowIsActive"]) }; lstTopEmployer.Add(topEmployer); } } return(lstTopEmployer); }