public ActionResult JobAnalytics() { jobList = jobModel.GetJobAnalytics(); var jobPosters = new List <string>(); var jobCategories = new List <string>(); var budgetAXP = 0m; analyticsObj.JobAnalytics = new List <JobAnalytics>(); foreach (var job in jobList) { if (!jobPosters.Contains(job.FullName)) { jobPosters.Add(job.FullName); } if (!jobCategories.Contains(job.Category)) { jobCategories.Add(job.Category); } budgetAXP += job.BudgetASP; analyticsObj.JobAnalytics.Add(new JobAnalytics { Date = job.CreatedDate.ToString(), JobID = job.JobReferanceId, Category = job.Category, PosterBy = job.FullName, AXP = job.BudgetASP, Response = job.Bid }); } analyticsObj.TotalJobs = jobList.Count; analyticsObj.TotalJobPosters = jobList.FirstOrDefault().TotalJobPosters; analyticsObj.TotalBudget = budgetAXP; analyticsObj.Categories = jobCategories; analyticsObj.Posters = jobPosters; return(PartialView(analyticsObj)); }