public void AddConverter(Converter converter, DynamoDBEntryConversion conversion) { if (converter == null) { throw new ArgumentNullException("converter"); } if (conversion == null) { throw new ArgumentNullException("conversion"); } if (conversion.IsImmutable) { throw new InvalidOperationException("Adding converters to immutable conversion is not supported. The conversion must be cloned first."); } converter.Conversion = conversion; var types = converter.GetTargetTypes(); foreach (var type in types) { Cache[type] = converter; } }
static DynamoDBEntryConversion() { V1 = new DynamoDBEntryConversion(ConversionSchema.V1, isImmutable: true); V2 = new DynamoDBEntryConversion(ConversionSchema.V2, isImmutable: true); }
/// <summary> /// Set the conversion to V1. /// </summary> public SetPropertyConverter() { Conversion = DynamoDBEntryConversion.V1; }