public static void Main() { var disciplines = GetDisciplines(); var teacher = new Teacher("Ivaylo Kenov", disciplines); teacher.AddComment("The best one!"); var student = new Student("Ivancho"); Console.WriteLine(student.ID); var course = new Course("a"); course.AddTeacher(teacher); course.AddStudent(student); }
public void EditStudent(Student entity) { this.db.Students.FirstOrDefault(t => t.Id == entity.Id).ModifiedOn = DateTime.Now; this.db.SaveChanges(); }
public void CreateStudent(Student entity) { this.db.Students.Add(entity); this.db.SaveChanges(); }
public void DeleteStudent(Student entity) { entity.IsDeleted = true; entity.DeletedOn = DateTime.Now; this.db.SaveChanges(); }