@ -36,7 +36,7 @@ namespace Volo.Abp.Domain.Entities
//Transient objects are not considered as equal
var other = (Entity<TKey>)obj;
if (EntityHelper.IsTransient(this) && EntityHelper.IsTransient(other))
if (EntityHelper.HasDefaultId(this) && EntityHelper.HasDefaultId(other))
{
return false;
}
@ -16,7 +16,7 @@ namespace Volo.Abp.Domain.Entities
return typeof(IEntity).IsAssignableFrom(type);
public static bool IsTransient<TKey>(IEntity<TKey> entity) // TODO: Completely remove IsTransient
public static bool HasDefaultId<TKey>(IEntity<TKey> entity)
if (EqualityComparer<TKey>.Default.Equals(entity.Id, default))
@ -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<TEntity, TKey>();