public void InsertElement(TEntity Obj) { // dbSet.Add(Obj); context.Attach(Obj).State = EntityState.Added; context.SaveChanges(); context.Entry(Obj).State = EntityState.Detached; }