コード例 #1
0
 public void DeleteEmployeeInfo (Employee Entities)
   {
     using(var context = new WorkScheduleDBContext())
     {
         var existingvalue = context.Employees.Find(Entities.EmployeeID);
         context.Employees.Remove(existingvalue);
         context.SaveChanges();
     }
   }
コード例 #2
0
 public void UpdateEmployeeInfo(Employee Entities)
 {
       using (var context = new WorkScheduleDBContext())
       {
           var updating = context.Employees.Attach(Entities);
           var matchingWithExistingValues = context.Entry<Employee>(updating);
           matchingWithExistingValues.State = System.Data.Entity.EntityState.Modified;
           context.SaveChanges();
       }
 }
コード例 #3
0
  public void AddEmployeeInfo (Employee Entities)
 {
       using(var context = new WorkScheduleDBContext())
       { var adding = context.Employees.Add(Entities); context.SaveChanges(); }
 }