Пример #1
0
        private static void AddStudent()
        {
            using (DBModelContainer context = new DBModelContainer())
            {
                Student s = new Student();

                Console.Write("Student First Name: ");
                s.FirstName = Console.ReadLine();

                Console.Write("Student Last Name: ");
                s.LastName = Console.ReadLine();

                Console.Write("Student Registration Number: ");
                s.Number = Console.ReadLine();

                context.Students.Add(s);
                context.SaveChanges();

            }
        }
Пример #2
0
 private static void DisplayStudent(Student student)
 {
     Console.WriteLine(string.Format("{0} - {1}",student.Number, student.Name));
 }