예제 #1
0
 private void button3_Click(object sender, EventArgs e)
 {
     using (var ctx = new OnlineExamBD())
     {
         foreach (var code in CoursesList)
         {
             ctx.Entry(code).State = EntityState.Deleted;
             ctx.SaveChanges();
         }
     }
 }
예제 #2
0
            public void FillingInTheDatabase(List <Courses> values)
            {
                using (var ctx = new OnlineExamBD())
                {
                    foreach (var courses in values)
                    {
                        ctx.Courses.Add(courses);
                    }

                    ctx.SaveChanges();
                }
            }