public Result <bool> Attach(byte[] streamId, long expiresAt = DefaultExpirationTimestamp)
        {
            var streamToAttach = new ActivityStream(streamId, expiresAt);

            if (AttachedStreams.Add(streamToAttach))
            {
                return(Result.Success);
            }
            return(Result.Error("Stream is already attached"));
        }
        public Result <bool> Detach(byte[] streamId, DateTime detachedSince)
        {
            var streamToDetach = new ActivityStream(streamId);
            var detachedStream = AttachedStreams.Where(x => ByteArrayHelper.Compare(x.StreamId, streamId)).SingleOrDefault() ?? ActivityStream.Empty;

            if (IsEmpty(detachedStream))
            {
                return(Result.Error("No stream found to detach."));
            }

            if (detachedStream.HasExpiration)
            {
                return(Result.Error($"Stream is already detached since {DateTime.FromFileTimeUtc(ExpiresAt).ToShortDateString()}."));
            }

            detachedStream.ExpiresAt = detachedSince.ToFileTimeUtc();
            return(Result.Success);
        }