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