Show / Hide Table of Contents

Class EntityHelper

Some helper methods for entities.

Inheritance
System.Object
EntityHelper
Namespace: Volo.Abp.Domain.Entities
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
Type Name Description
IEntity entity1
IEntity entity2
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
Type Description
Type

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 Description
Type
Type Parameters
Name Description
TEntity

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
Name Description
TKey

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
Name Description
TKey
Back to top Powered by Volosoft