コード例 #1
0
 public static void Add(Employee emp)
 {
     using (var context = new SoftUniEntities())
     {
         context.Employees.Add(emp);
         context.SaveChanges();
     }
 }
コード例 #2
0
 public static void Add(Employee emp)
 {
     using (var context = new SoftUniEntities())
     {
         context.Employees.Add(emp);
         context.SaveChanges();
     }
 }
コード例 #3
0
        public static void Delete(Employee emp)
        {
            using (var context = new SoftUniEntities())
            {
                context.Employees.Attach(emp);
                context.Employees.Remove(emp);

                context.SaveChanges();
            }
        }
コード例 #4
0
        public static void Delete(Employee emp)
        {
            using (var context = new SoftUniEntities())
            {
                context.Employees.Attach(emp);
                context.Employees.Remove(emp);

                context.SaveChanges();
            }
        }