When designing your own project in C # technology of WPF and querying data on the Entity Framework 6, the question was how to implement one query. I have 4 classes of entities that are respectively generated into tables:
class Spetsialnist { public int id {get; set;} public string NameSpets {get; set;} } class Group { public int id {get; set;} public string NumberGroup {get; set;} public int SpetsId; } class Student { public int id {get; set;} public string Name {get; set;} public int GroupId {get; set;} } class Otsinka { public int id {get;set;} public double mark {get;set;} public int semestr {get;set;} public int StudentId {get;set;) } Data context:
class StudentContext : DbContext { public DbSet<Vnz> Vnzs { get; set; } public DbSet<Vidilena> Vidilenas { get; set; } public DbSet<Spetsialnist> Spetsialnists { get; set; } public DbSet<Group> Groups { get; set; } public DbSet<Student> Students { get; set; } public DbSet<Otsinka> Otsinkas { get; set; } } Help to realize the request and get a list of two values (StudentName, AverageMark) based on NameSpets (that is, the user chooses a certain specialty to which the group is tied, in turn, the student is tied to the group, and his grades are tied to the student) taking into account the choice of semester, and should also calculate the average score for each student.