Class EntityHelper
Some helper methods for entities.
Inheritance
System.Object
EntityHelper
Assembly: Volo.Abp.Ddd.Domain.dll
Syntax
public static class EntityHelper : object
Methods
CreateEqualityExpressionForId<TEntity, TKey>(TKey)
Declaration
public static Expression<Func<TEntity, bool>> CreateEqualityExpressionForId<TEntity, TKey>(TKey id)
where TEntity : IEntity<TKey>
Parameters
Type |
Name |
Description |
TKey |
id |
|
Returns
Type |
Description |
Expression<Func<TEntity, System.Boolean>> |
|
Type Parameters
Name |
Description |
TEntity |
|
TKey |
|
EntityEquals(IEntity, IEntity)
Declaration
public static bool EntityEquals(IEntity entity1, IEntity entity2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
FindPrimaryKeyType(Type)
Tries to find the primary key type of the given entity type.
May return null if given type does not implement IEntity<TKey>
Declaration
public static Type FindPrimaryKeyType(Type entityType)
Parameters
Type |
Name |
Description |
Type |
entityType |
|
Returns
FindPrimaryKeyType<TEntity>()
Tries to find the primary key type of the given entity type.
May return null if given type does not implement IEntity<TKey>
Declaration
public static Type FindPrimaryKeyType<TEntity>()
where TEntity : IEntity
Returns
Type Parameters
HasDefaultId<TKey>(IEntity<TKey>)
Declaration
public static bool HasDefaultId<TKey>(IEntity<TKey> entity)
Parameters
Type |
Name |
Description |
IEntity<TKey> |
entity |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
HasDefaultKeys(IEntity)
Declaration
public static bool HasDefaultKeys(IEntity entity)
Parameters
Type |
Name |
Description |
IEntity |
entity |
|
Returns
Type |
Description |
System.Boolean |
|
IsEntity(Type)
Declaration
public static bool IsEntity(Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
Type |
Description |
System.Boolean |
|
IsEntityWithId(Type)
Declaration
public static bool IsEntityWithId(Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
Type |
Description |
System.Boolean |
|
TrySetId<TKey>(IEntity<TKey>, Func<TKey>, Boolean)
Declaration
public static void TrySetId<TKey>(IEntity<TKey> entity, Func<TKey> idFactory, bool checkForDisableIdGenerationAttribute = false)
Parameters
Type |
Name |
Description |
IEntity<TKey> |
entity |
|
Func<TKey> |
idFactory |
|
System.Boolean |
checkForDisableIdGenerationAttribute |
|
Type Parameters