public void Cnd_AddEmp(CndEmployee emp)
 {
     using (var context = new CndContext())
     {
         context.CndEmployees.Add(emp);
         context.SaveChanges();
     }
 }
예제 #2
0
 static void AddEmp_Cnd()
 {
     DAL.CodeFirsApproaches.CndEmployee emp = new DAL.CodeFirsApproaches.CndEmployee
     {
         Name = "ashok",
         Salary=12000,
         IsTerminated = true
     };
     codeFirstOperations.Cnd_AddEmp(emp);
 }