diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs index 685df3a8be..638ff0d3e1 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs @@ -36,7 +36,7 @@ namespace Volo.Abp.Domain.Entities //Transient objects are not considered as equal var other = (Entity)obj; - if (EntityHelper.IsTransient(this) && EntityHelper.IsTransient(other)) + if (EntityHelper.HasDefaultId(this) && EntityHelper.HasDefaultId(other)) { return false; } diff --git a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/EntityHelper.cs b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/EntityHelper.cs index 18f6f2a8e9..7f6febe354 100644 --- a/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/EntityHelper.cs +++ b/src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/EntityHelper.cs @@ -16,7 +16,7 @@ namespace Volo.Abp.Domain.Entities return typeof(IEntity).IsAssignableFrom(type); } - public static bool IsTransient(IEntity entity) // TODO: Completely remove IsTransient + public static bool HasDefaultId(IEntity entity) { if (EqualityComparer.Default.Equals(entity.Id, default)) { diff --git a/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs b/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs index 1f47825067..491338acca 100644 --- a/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs +++ b/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs @@ -64,7 +64,7 @@ namespace Volo.Abp.Domain.Repositories.MemoryDb { if (typeof(TKey) == typeof(int) || typeof(TKey) == typeof(long) || typeof(TKey) == typeof(Guid)) { - if (EntityHelper.IsTransient(entity)) + if (EntityHelper.HasDefaultId(entity)) { entity.Id = Database.GenerateNextId(); }