예제 #1
0
 /// <summary>
 ///     Builds the <see cref="ProductAttributeDto" />.
 /// </summary>
 /// <param name="entity">
 ///     The entity.
 /// </param>
 /// <returns>
 ///     The <see cref="ProductAttributeDto" />.
 /// </returns>
 public ProductAttributeDto BuildDto(IProductAttribute entity)
 {
     return(new ProductAttributeDto
     {
         Key = entity.Key,
         OptionKey = entity.OptionKey,
         Name = entity.Name,
         Sku = entity.Sku,
         SortOrder = entity.SortOrder,
         IsDefaultChoice = entity.IsDefaultChoice,
         DetachedContentValues = DetachedContentValuesSerializationHelper.Serialize(entity.DetachedDataValues),
         UpdateDate = entity.UpdateDate,
         CreateDate = entity.CreateDate
     });
 }
예제 #2
0
 /// <summary>
 /// Builds the <see cref="ProductVariantDetachedContentDto"/>.
 /// </summary>
 /// <param name="entity">
 /// The entity.
 /// </param>
 /// <returns>
 /// The <see cref="ProductVariantDetachedContentDto"/>.
 /// </returns>
 public ProductVariantDetachedContentDto BuildDto(IProductVariantDetachedContent entity)
 {
     return(new ProductVariantDetachedContentDto()
     {
         Key = entity.Key,
         CultureName = entity.CultureName,
         DetachedContentTypeKey = entity.DetachedContentType.Key,
         ProductVariantKey = entity.ProductVariantKey,
         Slug = !entity.Slug.IsNullOrWhiteSpace() ? entity.Slug : null,
         TemplateId = entity.TemplateId > 0 ? entity.TemplateId : null,
         CanBeRendered = entity.CanBeRendered,
         Values = DetachedContentValuesSerializationHelper.Serialize(entity.DetachedDataValues),
         CreateDate = entity.CreateDate,
         UpdateDate = entity.UpdateDate
     });
 }