public CollectionBuilder AddParcel(Parcel parcel)
        {
            _collection.Add("parcel[weight]".ToKvp(parcel.Weight));
            if (parcel.PredefinedPackage == UspsParcelType.Unknown)
            {
                _collection.Add("parcel[length]".ToKvp(parcel.Length.ToString()));
                _collection.Add("parcel[width]".ToKvp(parcel.Width.ToString()));
                _collection.Add("parcel[height]".ToKvp(parcel.Height.ToString()));
            }
            else
            {
                _collection.Add("parcel[predefined_package]".ToKvp(parcel.PredefinedPackage.ToString()));
            }

            return this;
        }
Exemple #2
0
 protected bool Equals(Parcel other)
 {
     return PredefinedPackage == other.PredefinedPackage && Weight == other.Weight && Height == other.Height && Width == other.Width && Length == other.Length;
 }