Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductVariantDetachedContent"/> class.
        /// </summary>
        /// <param name="productVariantKey">
        /// The product variant key.
        /// </param>
        /// <param name="detachedContentType">
        /// The detached content type.
        /// </param>
        /// <param name="cultureName">
        /// The culture name.
        /// </param>
        /// <param name="detachedDataValuesCollection">
        /// The detached data values collection.
        /// </param>
        public ProductVariantDetachedContent(
            Guid productVariantKey,
            IDetachedContentType detachedContentType,
            string cultureName,
            DetachedDataValuesCollection detachedDataValuesCollection)
        {
            Mandate.ParameterCondition(!Guid.Empty.Equals(productVariantKey), "productVariantKey");
            Mandate.ParameterNotNull(detachedContentType, "detachedContentType");
            Mandate.ParameterNotNullOrEmpty(cultureName, "cultureName");

            this.ProductVariantKey   = productVariantKey;
            this.DetachedContentType = detachedContentType;
            this.CultureName         = cultureName;
            this.DetachedDataValues  = detachedDataValuesCollection;
        }
Exemple #2
0
 /// <summary>
 /// Converts data values collection data into a more easily serializable collection for display classes (back office UI)
 /// </summary>
 /// <param name="dataValues">The <see cref="DetachedDataValuesCollection"/></param>
 /// <returns>An <c>IEnumerable{object}</c></returns>
 internal static IEnumerable <KeyValuePair <string, string> > AsEnumerable(this DetachedDataValuesCollection dataValues)
 {
     return(dataValues.Select(item => new KeyValuePair <string, string>(item.Key, item.Value ?? string.Empty)));
 }