Esempio n. 1
0
        public IEnumerable <TrainingTypeCountChartDTO> GetCountMonthByTypeTraining(int idAthlete)
        {
            var trainings = GetAllByAthleteLast30Days(idAthlete);
            var types     = trainingTypeRepository.GetAll();
            var atlhete   = athleteRepository.FindById(idAthlete);
            List <TrainingTypeCountChartDTO> result = new List <TrainingTypeCountChartDTO>();
            var cos = atlhete.Trainings;

            foreach (var type in types)
            {
                if (type.IdTrainingType != 11 && type.IdTrainingType != 1)
                {
                    var counter = trainings.Where(x => x.IdTrainingType == type.IdTrainingType).Count();
                    result.Add(new TrainingTypeCountChartDTO()
                    {
                        Name = type.TrainingName, Count = counter
                    });
                }
            }
            return(result);
        }
Esempio n. 2
0
 public Athlete FindById(int Id)
 {
     return(_athleteRepository.FindById(Id));
 }