public object FromEntry(DynamoDBEntry entry) { if ((null == entry) || (null != entry.AsDynamoDBNull())) { return(null); } var list = entry.AsDynamoDBList(); if (null == list) { throw new ArgumentException("Field value is not a DynamoDBList. This attribute has been used on a property that is not a list of custom objects."); } return(list.AsListOfDocument().Select(x => JsonSerializer.Deserialize <T>(x.ToJson(), CreateJsonOptions())).ToList()); }
public object FromEntry(DynamoDBEntry entry) { if ((null == entry) || (null != entry.AsDynamoDBNull())) { return(null); } var list = entry.AsDynamoDBList(); if (null == list) { throw new ArgumentException("Field value is not a DynamoDBList. This attribute has been used on a property that is not a list of enum values."); } return(list.AsListOfDynamoDBEntry().Select(x => (TEnum)Enum.Parse(typeof(TEnum), x.AsString())).ToList()); }
public static IList <Leg> UnpackLegs(DynamoDBEntry dBEntry) => dBEntry?.AsDynamoDBList().Entries.Select(x => UnpackLeg(x.AsDocument())).ToList();