1.错误信息 org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist: sys.entity.Role; nested exception is org.hibernate.PersistentObjectException: detached entity passed to persist: sys.entity.Role at org.springframew
public override int SaveChanges() { var changedEntities = ChangeTracker.Entries().Where(e => e.State == EntityState.Added || e.State == EntityState.Modified).ToList(); var now = DateTime.Now; changedEntities.ForEach(e => { if (e.State == EntityState