Class EntityDescriptorFactoryExtensions
Inherited Members
Namespace: LemonEdge.API.Descriptors
Assembly: LemonEdge.API.dll
Syntax
public static class EntityDescriptorFactoryExtensions
Methods
FromTypeName(IEntityDescriptorFactory, string)
Declaration
public static EntityDescriptor FromTypeName(this IEntityDescriptorFactory factory, string entityTypeName)
Parameters
Type | Name | Description |
---|---|---|
IEntityDescriptorFactory | factory | |
string | entityTypeName |
Returns
Type | Description |
---|---|
EntityDescriptor |
GetAllDependantEntities(IEntityDescriptorFactory, EntityDescriptor)
Returns a list of all EntityDescriptor that are dependant on the specified EntityDescriptor and, in turn, their child dependencies too.
Declaration
public static IEnumerable<EntityDescriptor> GetAllDependantEntities(this IEntityDescriptorFactory factory, EntityDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
IEntityDescriptorFactory | factory | The EntityDescriptorFactory instance. |
EntityDescriptor | descriptor | The EntityDescriptor to get all child dependant EntityDescriptor for. |
Returns
Type | Description |
---|---|
IEnumerable<EntityDescriptor> | A list of all EntityDescriptor that are dependant on the specified EntityDescriptor and, in turn, their child dependencies too. |
GetCachedDescriptors(IEntityDescriptorFactory)
Returns all descriptors that are part of the standing data cache
Declaration
public static IEnumerable<EntityDescriptor> GetCachedDescriptors(this IEntityDescriptorFactory factory)
Parameters
Type | Name | Description |
---|---|---|
IEntityDescriptorFactory | factory |
Returns
Type | Description |
---|---|
IEnumerable<EntityDescriptor> | All descriptors that are part of the standing data cache |
GetDescriptorsInSaveOrder(IEntityDescriptorFactory, IEnumerable<EntityDescriptor>)
Returns all the specified entity descriptors in the order that they should be saved in so dependencies are correct
Declaration
public static IEnumerable<EntityDescriptor> GetDescriptorsInSaveOrder(this IEntityDescriptorFactory factory, IEnumerable<EntityDescriptor> descriptors)
Parameters
Type | Name | Description |
---|---|---|
IEntityDescriptorFactory | factory | The EntityDescriptorFactory instance. |
IEnumerable<EntityDescriptor> | descriptors | A list of entity descriptors that should be sorted into the order in which they should be saved |
Returns
Type | Description |
---|---|
IEnumerable<EntityDescriptor> | All the specified entity descriptors in the order that they should be saved in so dependencies are correct |
GetDirectDependantEntities(IEntityDescriptorFactory, EntityDescriptor, bool)
Returns a list of all entity descriptors that are directly dependant on the specified descriptor through relationships
Declaration
public static IEnumerable<EntityDescriptor> GetDirectDependantEntities(this IEntityDescriptorFactory factory, EntityDescriptor descriptor, bool includeParentToAnyRelationships = true)
Parameters
Type | Name | Description |
---|---|---|
IEntityDescriptorFactory | factory | The EntityDescriptorFactory instance. |
EntityDescriptor | descriptor | The entity descriptor to return all directly dependant entity descriptors for |
bool | includeParentToAnyRelationships | Indicates if relationships that can have any entity as a parent should be included in the results. |
Returns
Type | Description |
---|---|
IEnumerable<EntityDescriptor> | A list of all entity descriptors that are directly dependant on the specified descriptor through relationships |
GetItemsInTypeReverseSaveOrder(IEntityDescriptorFactory, IReadOnlyCollection<IBaseEntity>)
Returns the specified set of entities in the reverse order they should be saved in
Declaration
public static IEnumerable<IBaseEntity> GetItemsInTypeReverseSaveOrder(this IEntityDescriptorFactory factory, IReadOnlyCollection<IBaseEntity> items)
Parameters
Type | Name | Description |
---|---|---|
IEntityDescriptorFactory | factory | The EntityDescriptorFactory instance. |
IReadOnlyCollection<IBaseEntity> | items | A set of entities that should be ordered according to the reverse order in which they should be saved |
Returns
Type | Description |
---|---|
IEnumerable<IBaseEntity> | The specified set of entities in the reverse order they should be saved in |
GetItemsInTypeSaveOrder(IEntityDescriptorFactory, IReadOnlyCollection<IBaseEntity>)
Returns the specified set of entities in the order they should be saved in
Declaration
public static IEnumerable<IBaseEntity> GetItemsInTypeSaveOrder(this IEntityDescriptorFactory factory, IReadOnlyCollection<IBaseEntity> items)
Parameters
Type | Name | Description |
---|---|---|
IEntityDescriptorFactory | factory | The EntityDescriptorFactory instance. |
IReadOnlyCollection<IBaseEntity> | items | A set of entities that should be ordered according to the order in which they should be saved |
Returns
Type | Description |
---|---|
IEnumerable<IBaseEntity> | The specified set of entities in the order they should be saved in |
GetTypeDistinctDescriptors(IEntityDescriptorFactory)
Returns an EntityDescriptor for each entity within the system excluding ones that have been replicated from other entity descriptors
For example only one EntityDescriptor for IPermission would be returned, and not one for each entity descriptor in the system replicated for each one with permissions
Declaration
public static IEnumerable<EntityDescriptor> GetTypeDistinctDescriptors(this IEntityDescriptorFactory factory)
Parameters
Type | Name | Description |
---|---|---|
IEntityDescriptorFactory | factory |
Returns
Type | Description |
---|---|
IEnumerable<EntityDescriptor> | An EntityDescriptor for each entity within the system excluding ones that have been replicated from other entity descriptors |