From f646ecb32e17e2f078ca8f14eadba9354ca22cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 10 Mar 2018 20:54:23 +0300 Subject: [PATCH] Rename EntityHelper.IsTransient to EntityHelper.HasDefaultId --- src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/Entity.cs | 2 +- src/Volo.Abp.Ddd/Volo/Abp/Domain/Entities/EntityHelper.cs | 2 +- .../Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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(); }