/// <summary> /// Adds the specified name to this collection. /// </summary> /// <param name="name">The name of the attribute.</param> public override void Add(string name) { Add(name, () => { DynamoValidator.ThrowIfAttributeNameIsNotValid(name, nameof(name)); if (Contains(name)) { throw new ArgumentException("Name has already been added.", nameof(name)); } if (Count >= MaximumCollectionSize) { throw new ArgumentException("Unable to add attribute; cannot exceed a maximum of {0} attributes.".FormatWith(MaximumCollectionSize)); } }); }
/// <summary> /// Initializes a new instance of the <see cref="Key"/> class. /// </summary> /// <param name="keyName">The name of the key of a table or index.</param> /// <param name="keyType">The data type of the key of a table or index.</param> protected Key(string keyName, AttributeType keyType) { DynamoValidator.ThrowIfAttributeNameIsNotValid(keyName); Name = keyName; Type = keyType; }