public Rates GetRates(Guid slideId, string courseId) { var rates = new Rates(); var allRates = db.SlideRates.Where(x => x.SlideId == slideId).ToList(); foreach (var rate in allRates) { if (rate.Rate == SlideRates.Good) { rates.AddGood(); } if (rate.Rate == SlideRates.NotUnderstand) { rates.AddNotUnderstand(); } if (rate.Rate == SlideRates.NotWatched) { rates.AddNotWatched(); } if (rate.Rate == SlideRates.Trivial) { rates.AddTrivial(); } } return(rates); }
public Rates GetRates(Guid slideId, string courseId) { var rates = new Rates(); var allRates = db.SlideRates.Where(x => x.SlideId == slideId).ToList(); foreach (var rate in allRates) { if (rate.Rate == SlideRates.Good) rates.AddGood(); if (rate.Rate == SlideRates.NotUnderstand) rates.AddNotUnderstand(); if (rate.Rate == SlideRates.NotWatched) rates.AddNotWatched(); if (rate.Rate == SlideRates.Trivial) rates.AddTrivial(); } return rates; }