Class BusinessEntityExtensions
Represents BusinessEntity extensions.
public static class BusinessEntityExtensions
- Inheritance
-
BusinessEntityExtensions
- Inherited Members
Methods
GetEntityTypes<TEntity>(TEntity, bool)
Gets the entity types from an entity.
public static IList<Type> GetEntityTypes<TEntity>(this TEntity entity, bool includeBaseTypes = true) where TEntity : BusinessEntity
Parameters
entityTEntityThe entity.
includeBaseTypesboolIndicates whether the base types is included to the result or not.
Returns
Type Parameters
TEntityThe entity type.
IsNavigationLoaded<TEntity, TProperty>(TEntity, Expression<Func<TEntity, TProperty>>)
Checks whether a navigation property (reference or collection) is loaded.
public static bool IsNavigationLoaded<TEntity, TProperty>(this TEntity entity, Expression<Func<TEntity, TProperty>> navigationPropertyExpression) where TEntity : BusinessEntity
Parameters
entityTEntityThe business entity.
navigationPropertyExpressionExpression<Func<TEntity, TProperty>>Expression that specifies the navigation property.
Returns
- bool
true if the navigation is loaded; otherwise, false.
Type Parameters
TEntityThe entity type.
TPropertyThe navigation property type.
Remarks
This method allows checking if a navigation property has been loaded without triggering lazy loading. Returns false if no lazy loader is present or if the entity was not loaded from the persistence layer.
Exceptions
- ArgumentException
Thrown when the property is not a valid navigation property (reference or collection).