Example #1
0
        /// <summary>
        /// Adds a document version to the internal linked list.
        /// </summary>
        /// <param name="version">
        /// The document version to add.
        /// </param>
        public void AddVersion([NotNull] DocumentVersion version)
        {
            if (version == null)
            {
                throw new ArgumentNullException(nameof(version));
            }

            if (this.documentVersions.Add(version) == false)
            {
                throw new BusinessException(version, "The document already contains this version.");
            }

            version.AssociateWith(this);
        }