/// <summary>
        /// Creates a new instance of <see cref="EventCommitEnvelope"/>
        /// </summary>
        /// <param name="commitId"></param>
        /// <param name="events"></param>
        /// <param name="metadata"></param>
        public EventCommitEnvelope(string commitId, int commitVersion, TypedObject[] events, TypedObject metadata)
        {
            if (commitId == null) throw new ArgumentNullException(nameof(commitId));
            if (commitVersion <= 0) throw new ArgumentOutOfRangeException(nameof(commitVersion));
            if (events == null) throw new ArgumentNullException(nameof(events));
            if (events.Length == 0) throw new ArgumentException("Argument is empty collection", nameof(events));

            CommitId = commitId;
            CommitVersion = commitVersion;
            Events = events;
            Metadata = metadata;
        }
Example #2
0
        /// <summary>
        /// Creates a new instance of <see cref="EventCommitEnvelope"/>
        /// </summary>
        /// <param name="commitId"></param>
        /// <param name="events"></param>
        /// <param name="metadata"></param>
        public EventCommitEnvelope(string commitId, int commitVersion, TypedObject[] events, TypedObject metadata)
        {
            if (commitId == null)
            {
                throw new ArgumentNullException(nameof(commitId));
            }
            if (commitVersion <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(commitVersion));
            }
            if (events == null)
            {
                throw new ArgumentNullException(nameof(events));
            }
            if (events.Length == 0)
            {
                throw new ArgumentException("Argument is empty collection", nameof(events));
            }

            CommitId      = commitId;
            CommitVersion = commitVersion;
            Events        = events;
            Metadata      = metadata;
        }