using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pr13.Models
{
    public partial class Course
    {
        public string CountTeachers
        {
            get
            {
                int count = 0;
                foreach (var item in TeachersCourses)
                {
                    count++;
                }
                if (count == 0)
                {
                    return $"Никто не записался на этот курс";
                }
                else
                {
                    return $"{count} чел.";
                }
            }
        }
        public int? HoursCount
        {
            get
            {
                int? count = 0;
                foreach (var item in TeachersCourses)
                {
                    if (count == 0)
                    {
                        count += item.Hours;
                    }

                }
                return count;
            }

        }
    }
}
