private static TcpPackage WrapWriteEventsCompleted(ClientMessage.WriteEventsCompleted msg)
 {
     var dto = new TcpClientMessageDto.WriteEventsCompleted(msg.EventStreamId,
                                                         (int)msg.ErrorCode,
                                                         msg.Error,
                                                         msg.EventNumber);
     return new TcpPackage(TcpCommand.WriteEventsCompleted, msg.CorrelationId, dto.Serialize());
 }
 private static TcpPackage WrapWriteEventsCompleted(ClientMessage.WriteEventsCompleted msg)
 {
     var dto = new TcpClientMessageDto.WriteEventsCompleted((TcpClientMessageDto.OperationResult) msg.Result,
                                                            msg.Message,
                                                            msg.FirstEventNumber,
                                                            msg.LastEventNumber,
                                                            msg.PreparePosition,
                                                            msg.CommitPosition);
     return new TcpPackage(TcpCommand.WriteEventsCompleted, msg.CorrelationId, dto.Serialize());
 }