Skip to content

Commit b4c7204

Browse files
committed
fix carton centect feed
1 parent 969738e commit b4c7204

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Source/FikaAmazonAPI/ConstructFeed/Messages/CartonContentsRequest.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using System.Xml.Serialization;
34

45
namespace FikaAmazonAPI.ConstructFeed.Messages
@@ -9,7 +10,11 @@ public class CartonContentsRequest
910
[XmlElement(ElementName = "ShipmentId")]
1011
public string ShipmentId { get; set; }
1112
[XmlElement(ElementName = "NumCartons")]
12-
public int NumCartons { get { return Carton.Count; } }
13+
public int NumCartons
14+
{
15+
get { return Carton.Count; }
16+
set { /* required for xml serialization */ }
17+
}
1318
[XmlElement(ElementName = "Carton")]
1419
public List<Carton> Carton { get; set; } = new List<Carton>();
1520
}
@@ -32,5 +37,18 @@ public class CartonItem
3237
public int QuantityShipped { get; set; }
3338
[XmlElement(ElementName = "QuantityInCase")]
3439
public int QuantityInCase { get; set; }
40+
41+
[XmlIgnore]
42+
public Nullable<DateTime> ExpirationDate { get; set; }
43+
44+
[XmlElement(ElementName = "ExpirationDate")]
45+
public string ExpirationDateFormatted
46+
{
47+
get { return this.ExpirationDate.Value.ToString("yyyy-MM-dd"); }
48+
set { this.ExpirationDate = DateTime.Parse(value); }
49+
}
50+
51+
[XmlIgnore]
52+
public bool ExpirationDateSpecified { get { return ExpirationDate != null; } }
3553
}
3654
}

0 commit comments

Comments
 (0)