public static bool IsGroupValid(string groupName) { using (MarksContext db = new MarksContext()) { return(db.Students.Any(i => i.Group.Equals(groupName))); } }
public static bool IsCourseValid(string courseName) { using (MarksContext db = new MarksContext()) { return(!db.Courses.Any(i => i.Name.Equals(courseName))); } }
public Student() { Courses = new HashSet <Course>(); if (Id != 0) { using (MarksContext db = new MarksContext()) { Marks = db.Marks.Where(i => i.StudentId == Id).AsEnumerable(); } } }