/// <summary> /// Convert from <see cref="Artifacts.Artifact"/> to <see cref="grpc.Artifact"/>. /// </summary> /// <param name="artifact"><see cref="Artifacts.Artifact"/> to convert from.</param> /// <returns>Converted <see cref="grpc.Artifact"/>.</returns> public static grpc.Artifact ToProtobuf(this Artifacts.Artifact artifact) { var message = new grpc.Artifact { Id = Dolittle.Protobuf.Extensions.ToProtobuf(artifact.Id), Generation = artifact.Generation.Value }; return(message); }
/// <summary> /// Convert from <see cref="grpc.Artifact"/> to <see cref="Artifacts.Artifact"/>. /// </summary> /// <param name="message"><see cref="grpc.Artifact"/> to convert from.</param> /// <returns>Converted <see cref="Artifacts.Artifact"/>.</returns> public static Artifacts.Artifact ToArtifact(this grpc.Artifact message) { return(new Artifacts.Artifact( message.Id.To <Artifacts.ArtifactId>(), message.Generation)); }