/// <summary> /// Allows you to convert the current product option item object to the DTO equivalent for use with the REST API /// </summary> /// <returns>A new instance of OptionItemDTO</returns> public OptionItemDTO ToDto() { var dto = new OptionItemDTO(); dto.Bvin = Bvin; dto.IsLabel = IsLabel; dto.Name = Name; dto.OptionBvin = OptionBvin; dto.PriceAdjustment = PriceAdjustment; dto.SortOrder = SortOrder; dto.StoreId = StoreId; dto.WeightAdjustment = WeightAdjustment; dto.IsDefault = IsDefault; return(dto); }
//DTO public OptionItemDTO ToDto() { OptionItemDTO dto = new OptionItemDTO(); dto.Bvin = this.Bvin; dto.IsLabel = this.IsLabel; dto.Name = this.Name; dto.OptionBvin = this.OptionBvin; dto.PriceAdjustment = this.PriceAdjustment; dto.SortOrder = this.SortOrder; dto.StoreId = this.StoreId; dto.WeightAdjustment = this.WeightAdjustment; return(dto); }
public void FromDto(OptionItemDTO dto) { if (dto == null) { return; } this.Bvin = dto.Bvin ?? string.Empty; this.IsLabel = dto.IsLabel; this.Name = dto.Name ?? string.Empty; this.OptionBvin = dto.OptionBvin ?? string.Empty; this.PriceAdjustment = dto.PriceAdjustment; this.SortOrder = dto.SortOrder; this.StoreId = dto.StoreId; this.WeightAdjustment = dto.WeightAdjustment; }
/// <summary> /// Allows you to populate the current product option item object using an instance of OptionItemDTO /// </summary> /// <param name="dto">An instance of the product option item from the REST API</param> public void FromDto(OptionItemDTO dto) { if (dto == null) { return; } Bvin = dto.Bvin ?? string.Empty; IsLabel = dto.IsLabel; Name = dto.Name ?? string.Empty; OptionBvin = dto.OptionBvin ?? string.Empty; PriceAdjustment = dto.PriceAdjustment; SortOrder = dto.SortOrder; StoreId = dto.StoreId; WeightAdjustment = dto.WeightAdjustment; IsDefault = dto.IsDefault; }