static void Main()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<SchoolSystemContext, Configuration>());

            var db = new SchoolSystemContext();

            var newStudent = new Student { Name = "Random Person", Number = "99999", };
            db.Students.Add(newStudent);

            db.SaveChanges();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            SchoolSystemContext context = new SchoolSystemContext();

            Student sampleStudent = new Student();

            sampleStudent.Name = "Name2";

            context.Students.Add(sampleStudent);

            context.SaveChanges();
        }