//DTO
 public WishListItemDTO ToDto()
 {
     WishListItemDTO dto = new WishListItemDTO();
     dto.Id = this.Id;
     dto.StoreId = this.StoreId;
     dto.CustomerId = this.CustomerId;
     dto.LastUpdatedUtc = this.LastUpdatedUtc;
     dto.ProductId = this.ProductId ?? string.Empty;
     dto.Quantity = this.Quantity;
     foreach (Catalog.OptionSelection op in this.SelectionData)
     {
         dto.SelectionData.Add(op.ToDto());
     }
     return dto;
 }
        public void FromDto(WishListItemDTO dto)
        {
            if (dto == null) return;

            this.Id = dto.Id;
            this.StoreId = dto.StoreId;
            this.CustomerId = dto.CustomerId;
            this.LastUpdatedUtc = dto.LastUpdatedUtc;
            this.ProductId = dto.ProductId ?? string.Empty;
            this.Quantity = dto.Quantity;
            this.SelectionData.Clear();
            if (dto.SelectionData != null)
            {
                foreach (OptionSelectionDTO op in dto.SelectionData)
                {
                    Catalog.OptionSelection o = new Catalog.OptionSelection();
                    o.FromDto(op);
                    this.SelectionData.Add(o);
                }
            }
        }
Exemple #3
0
 public ApiResponse<WishListItemDTO> WishListItemsUpdate(WishListItemDTO item)
 {
     ApiResponse<WishListItemDTO> result = new ApiResponse<WishListItemDTO>();
     result = RestHelper.PostRequest<ApiResponse<WishListItemDTO>>(this.fullApiUri + "wishlistitems/" + item.Id + "?key=" + Enc(key), MerchantTribe.Web.Json.ObjectToJson(item));
     return result;
 }