/// <summary>
        /// Adds a <see cref="DomainObject"/> to the collection.
        /// </summary>
        /// <param name="domainObject">The <see cref="DomainObject"/> to add. Must not be <see langword="null"/>.</param>
        /// <returns>The zero-based index where the <paramref name="domainObject"/> has been added.</returns>
        /// <exception cref="System.NotSupportedException">The collection is read-only.</exception>
        /// <exception cref="System.ArgumentNullException"><paramref name="domainObject"/> is <see langword="null"/>.</exception>
        /// <exception cref="ArgumentException"><paramref name="domainObject"/> is not of type <see cref="RequiredItemType"/> or one of its derived types.</exception>
        /// <exception cref="DataManagement.ClientTransactionsDifferException">
        ///   <paramref name="domainObject"/> belongs to a <see cref="ClientTransaction"/> that is different from the <see cref="ClientTransaction"/>
        ///   managing this collection.
        ///   This applies only to <see cref="DomainObjectCollection"/>s that represent a relation.
        /// </exception>
        public int Add(DomainObject domainObject)
        {
            ArgumentUtility.CheckNotNull("domainObject", domainObject);
            this.CheckNotReadOnly("Cannot add an item to a read-only collection.");

            _dataStrategy.Insert(Count, domainObject);
            return(Count - 1);
        }
        public static void Add(this IDomainObjectCollectionData data, DomainObject domainObject)
        {
            ArgumentUtility.CheckNotNull("data", data);
            ArgumentUtility.CheckNotNull("domainObject", domainObject);

            data.Insert(data.Count, domainObject);
        }
 public virtual void Insert(int index, DomainObject domainObject)
 {
     ArgumentUtility.CheckNotNull("domainObject", domainObject);
     _wrappedData.Insert(index, domainObject);
 }