/////////////////////////////////////////////////////////////////////////////////////////////////// ////////////BUILD FROM MUTABLE OBJECT ////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// #region Constructors and Destructors /// <summary> /// Initializes a new instance of the <see cref="ConstrainedDataKeyCore"/> class. /// </summary> /// <param name="mutable"> /// The mutable. /// </param> /// <param name="parent"> /// The parent. /// </param> public ConstrainedDataKeyCore(IConstrainedDataKeyMutableObject mutable, IConstraintDataKeySet parent) : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ConstrainedDataKey), parent) { this._keyValues = new List<IKeyValue>(); foreach (IKeyValue each in mutable.KeyValues) { this._keyValues.Add(new KeyValueImpl(each.Code, each.Concept)); } this.Validate(); }
/// <summary> /// The add constrained data key. /// </summary> /// <param name="key"> /// The key. /// </param> public virtual void AddConstrainedDataKey(IConstrainedDataKeyMutableObject key) { if (key == null) { this.constrainedKeys = new List<IConstrainedDataKeyMutableObject>(); } this.constrainedKeys.Add(key); }