EntityCollectionService
Documentation for the Merch EntityCollectionService
This service is used to manage entity collections. Both Static and Dynamic Collections are managed with the EntityCollectionService.
The EntityCollectionService is exposed through the MerchelloContext
var entityCollectionService = MerchelloContext.Current.Services.EntityCollectionService;
Class
public class EntityCollectionService : MerchelloRepositoryService,
IEntityCollectionService, IService
Constructors
Name | Description |
---|---|
EntityCollectionService() | Initializes a new instance of the EntityCollectionService class. |
EntityCollectionService(ILogger) | Initializes a new instance of the EntityCollectionService class. |
EntityCollectionService(IDatabaseUnitOfWorkProvider, RepositoryFactory, ILogger) | Initializes a new instance of the EntityCollectionService class. |
EntityCollectionService(IDatabaseUnitOfWorkProvider, RepositoryFactory, ILogger, IEventMessagesFactory) | Initializes a new instance of the EntityCollectionService class. |
Public Methods
Name | Description |
---|---|
ChildEntityCollectionCount | Returns the child collection count |
CreateEntityCollection(EntityType, Guid, String, Boolean) | Creates an entity collection without saving it to the database |
CreateEntityCollectionWithKey(EntityType, Guid, String, Boolean) | Creates an entity collection and saves it to the database |
Delete(IEntityCollection, Boolean) | Deletes a single entity collection. |
ExistsInCollection | Returns a value indicating whether or not an entity exists in a collection |
GetAll | Gets all collection |
GetByEntityTfKey | Gets collections by entity type |
GetByKey | Gets a collection by it's unique key |
GetByProviderKey | Gets collections for a given provider key |
GetChildren | Gets a collection's child collections |
GetFromCollection | Get an entity from a collection |
GetRootLevelEntityCollections() | Gets the root level entity collections |
GetRootLevelEntityCollections(Guid) | Gets the root level entity collections for a specific entity type. |
GetRootLevelEntityCollections(EntityType) | Gets the root level entity collections for a specific entity type. |
HasChildEntityCollections | Returns a value indicating whether or not a collection has child collections |
Save(IEntityCollection, Boolean) | Saves a single entity collection. |
Save(IEnumerable(IEntityCollection), Boolean) | Saves a collection of entity collections. |
Events
Name | Description |
---|---|
Creating | Occurs before create |
Created | Occurs after create |
Deleting | Occurs before delete |
Deleted | Occurs after delete |
Saving | Occurs before save |
Saved | Occurs after save |
Interface on GitHub
Updated less than a minute ago