using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal; namespace AvaloniaApplication5.Models { public partial class Teacher { public string summa { get { int summ = 0; foreach(var item in TeacherCourses) { if (item.TeacherId == Id) { int a = Convert.ToInt32(item.Course.Time); summ += a; } } if (summ > 0) { return "Курсы в общем объеме "+ summ +" часов:"; } else { return "Курсы не пройдены"; } } } public string FIO { get { return LastName + " " + FirstName + " " + PatronymicName; } } } }