Exemple #1
0
        /// <summary>
        /// Convert from <see cref="CommittedEventStreamWithContext"/> to <see cref="Runtime.Grpc.Interaction.CommittedEventStream"/>
        /// </summary>
        /// <param name="contextualEventStream"><see cref="CommittedEventStreamWithContext"/> to convert from</param>
        /// <returns>Converted <see cref="Runtime.Grpc.Interaction.CommittedEventStream"/></returns>
        public static Runtime.Grpc.Interaction.CommittedEventStreamWithContext ToProtobuf(this CommittedEventStreamWithContext contextualEventStream)
        {
            var protobuf = new Runtime.Grpc.Interaction.CommittedEventStreamWithContext
            {
                Commit  = contextualEventStream.EventStream.ToProtobuf(),
                Context = contextualEventStream.Context.ToProtobuf()
            };

            return(protobuf);
        }
Exemple #2
0
        /// <summary>
        /// Convert from <see cref="Runtime.Grpc.Interaction.CommittedEventStreamWithContext"/> to <see cref="CommittedEventStreamWithContext"/>
        /// </summary>
        /// <param name="protobuf"><see cref="Runtime.Grpc.Interaction.CommittedEventStreamWithContext"/> to convert from</param>
        /// <returns>Converted <see cref="CommittedEventStreamWithContext"/></returns>
        public static CommittedEventStreamWithContext ToCommittedEventStreamWithContext(this Runtime.Grpc.Interaction.CommittedEventStreamWithContext protobuf)
        {
            var context = protobuf.Context.ToExecutionContext();
            var committedEventStream = protobuf.Commit.ToCommittedEventStream();

            return(new CommittedEventStreamWithContext(committedEventStream, context));
        }