public ActionResult CalculateAggregate(int TrainingID) { DSRCManagementSystemEntities1 db = new DSRCManagementSystemEntities1(); int?Id = TrainingID; db.Sp_FeedbackCalculation(Id); var AggreList = (from fa in db.TrainingFeedbackAggregates join tfc in db.TrainingFeedBackCalcs on fa.TrainingId equals tfc.TrainingId where fa.TrainingId == TrainingID select new FeedbackAggregareModel { ContentRating = fa.ContentRating, PresentRating = fa.PresentRating, FacultyRating = fa.FacultyQRating, OverallRating = fa.OverAllRating, learntinprog = tfc.LearntInPgm }).FirstOrDefault(); //AggreList.Comments = db.TrainingFeedBackCalcs.Where(x => x.TrainingId == TrainingID).Select(o => o.Comments).ToList(); AggreList.Comments = db.TrainingFeedBackCalcs.Where(x => x.TrainingId == TrainingID && x.Comments != "Not given yet ").Select(o => o.Comments).ToList(); AggreList.Learn = db.TrainingFeedBackCalcs.Where(x => x.TrainingId == TrainingID && x.LearntInPgm != "Not given yet ").Select(o => o.LearntInPgm).ToList(); return(View(AggreList)); }