using Microsoft.AspNetCore.Http; using Nop.Core.Domain.Attributes; namespace Nop.Services.Attributes; /// /// Represents an attribute parser /// /// Type of the attribute (see ) /// Type of the attribute value (see ) public partial interface IAttributeParser where TAttribute : BaseAttribute where TAttributeValue : BaseAttributeValue { /// /// Gets selected attributes /// /// Attributes in XML format /// /// A task that represents the asynchronous operation /// The task result contains the selected attributes /// Task> ParseAttributesAsync(string attributesXml); /// /// Gets selected attribute identifiers /// /// Attributes in XML format /// Selected attribute identifiers IEnumerable ParseAttributeIds(string attributesXml); /// /// Remove an attribute /// /// Attributes in XML format /// Attribute identifier /// Updated result (XML format) string RemoveAttribute(string attributesXml, int attributeId); /// /// Get custom attributes from the passed form /// /// Form values /// Name of the attribute control /// /// A task that represents the asynchronous operation /// The task result contains the attributes in XML format /// Task ParseCustomAttributesAsync(IFormCollection form, string attributeControlName); /// /// Check whether condition of some attribute is met (if specified). Return "null" if not condition is specified /// /// Condition attributes (XML format) /// Selected attributes (XML format) /// /// A task that represents the asynchronous operation /// The task result contains the result /// Task IsConditionMetAsync(string conditionAttributeXml, string selectedAttributesXml); /// /// Gets selected attribute value /// /// Attributes in XML format /// Attribute identifier /// Attribute value IList ParseValues(string attributesXml, int attributeId); /// /// Get attribute values /// /// Attributes in XML format /// /// A task that represents the asynchronous operation /// The task result contains the attribute values /// Task> ParseAttributeValuesAsync(string attributesXml); /// /// Get attribute values /// /// Attributes in XML format /// Attribute values IAsyncEnumerable<(TAttribute attribute, IAsyncEnumerable values)> ParseAttributeValues(string attributesXml); /// /// Adds an attribute /// /// Attributes in XML format /// Attribute /// Attribute value /// Attributes string AddAttribute(string attributesXml, TAttribute attribute, string value); /// /// Validates attributes /// /// Attributes in XML format /// /// A task that represents the asynchronous operation /// The task result contains the warnings /// Task> GetAttributeWarningsAsync(string attributesXml); }