using Nop.Core; using Nop.Core.Domain.Common; namespace Nop.Services.Common; /// /// Generic attribute service interface /// public partial interface IGenericAttributeService { /// /// Deletes an attribute /// /// Attribute /// A task that represents the asynchronous operation Task DeleteAttributeAsync(GenericAttribute attribute); /// /// Deletes an attributes /// /// Attributes /// A task that represents the asynchronous operation Task DeleteAttributesAsync(IList attributes); /// /// Inserts an attribute /// /// attribute /// A task that represents the asynchronous operation Task InsertAttributeAsync(GenericAttribute attribute); /// /// Updates the attribute /// /// Attribute /// A task that represents the asynchronous operation Task UpdateAttributeAsync(GenericAttribute attribute); /// /// Get attributes /// /// Entity identifier /// Key group /// /// A task that represents the asynchronous operation /// The task result contains the get attributes /// Task> GetAttributesForEntityAsync(int entityId, string keyGroup); /// /// Save attribute value /// /// Property type /// Entity /// Key /// Value /// Store identifier; pass 0 if this attribute will be available for all stores /// A task that represents the asynchronous operation Task SaveAttributeAsync(BaseEntity entity, string key, TPropType value, int storeId = 0); /// /// Get an attribute of an entity /// /// Property type /// Entity /// Key /// Load a value specific for a certain store; pass 0 to load a value shared for all stores /// Default value /// /// A task that represents the asynchronous operation /// The task result contains the attribute /// Task GetAttributeAsync(BaseEntity entity, string key, int storeId = 0, TPropType defaultValue = default); /// /// Get an attribute of an entity /// /// Property type /// Entity type /// Entity identifier /// Key /// Load a value specific for a certain store; pass 0 to load a value shared for all stores /// Default value /// /// A task that represents the asynchronous operation /// The task result contains the attribute /// Task GetAttributeAsync(int entityId, string key, int storeId = 0, TPropType defaultValue = default) where TEntity : BaseEntity; }