/// <summary> /// Adds a new value to the collection /// </summary> /// <param name="obj">The value to add</param> protected void AddValue(object obj) { if (!this.Attribute.IsMultivalued && this.InternalValues.Count >= 1) { throw new TooManyValuesException(this.Attribute.Name); } if (!this.HasValue(obj)) { DataRow newRow = this.dataTable.NewRow(); this.dataTable.Rows.Add(newRow); newRow["objectId"] = this.objectId; newRow["attributeName"] = this.Attribute.Name; DBAttributeValue newValue = new DBAttributeValue(this.Attribute, newRow); newValue.SetValue(obj); this.InternalValues.Add(newValue); } }
public DBAttributeValuesSVWrapper(DBAttributeValue value) : base(value.Attribute) { this.internalValue = value; this.InternalValues.Add(value); }