Table of Contents

Class BusinessEntityExtensions

Namespace
GroupeIsa.Neos.Domain.Entities
Assembly
GroupeIsa.Neos.Domain.Abstractions.dll

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

entity TEntity

The entity.

includeBaseTypes bool

Indicates whether the base types is included to the result or not.

Returns

IList<Type>

The entity types.

Type Parameters

TEntity

The 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

entity TEntity

The business entity.

navigationPropertyExpression Expression<Func<TEntity, TProperty>>

Expression that specifies the navigation property.

Returns

bool

true if the navigation is loaded; otherwise, false.

Type Parameters

TEntity

The entity type.

TProperty

The 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).