public void Delete(Student entity) { if (entitieContext.Entry(entity).State == EntityState.Detached) { entitieContext.Set<Student>().Attach(entity); } entitieContext.Set<Student>().Remove(entity); }
public void Update(Student entity) { entitieContext.Set<Student>().Attach(entity); entitieContext.Entry(entity).State = EntityState.Modified; }
public Student Insert(Student entity) { entitieContext.Set<Student>().Add(entity); return entity; }