/// <summary> /// Convert from <see cref="VersionedEventSource"/> to <see cref="Runtime.Grpc.Interaction.VersionedEventSource"/> /// </summary> /// <param name="versionedEventSource"><see cref="VersionedEventSource"/> to convert from</param> /// <returns>Converted <see cref="Runtime.Grpc.Interaction.VersionedEventSource"/></returns> public static Runtime.Grpc.Interaction.VersionedEventSource ToProtobuf(this VersionedEventSource versionedEventSource) { var source = new Runtime.Grpc.Interaction.VersionedEventSource { Version = versionedEventSource.Version.ToProtobuf(), EventSource = versionedEventSource.EventSource.ToProtobuf(), Artifact = versionedEventSource.Artifact.ToProtobuf() }; return(source); }
/// <summary> /// Convert from <see cref="Runtime.Grpc.Interaction.VersionedEventSource"/> to <see cref="VersionedEventSource"/> /// </summary> /// <param name="protobuf"><see cref="Runtime.Grpc.Interaction.VersionedEventSource"/> to convert from</param> /// <returns>Converted <see cref="VersionedEventSource"/></returns> public static VersionedEventSource ToVersionedEventSource(this Runtime.Grpc.Interaction.VersionedEventSource protobuf) { return(new VersionedEventSource( protobuf.Version.ToEventSourceVersion(), new EventSourceKey(protobuf.EventSource.ToConcept <EventSourceId>(), protobuf.Artifact.ToConcept <ArtifactId>()))); }