示例#1
0
        public void Delete(Student entity)
        {
            if (entitieContext.Entry(entity).State == EntityState.Detached)
            {
                entitieContext.Set<Student>().Attach(entity);
            }

            entitieContext.Set<Student>().Remove(entity);
        }
示例#2
0
 public void Update(Student entity)
 {
     entitieContext.Set<Student>().Attach(entity);
     entitieContext.Entry(entity).State = EntityState.Modified;
 }
示例#3
0
 public Student Insert(Student entity)
 {
     entitieContext.Set<Student>().Add(entity);
     return entity;
 }