Ejemplo n.º 1
0
        private void EnsureFileMetadaWasSent(IAsyncStreamReader <StartUploadRequest> requestStream)
        {
            StartUploadRequest.UploadRequestOneofCase requestStartType = requestStream.Current.UploadRequestCase;

            if (requestStartType != StartUploadRequest.UploadRequestOneofCase.FileMetadata)
            {
                throw new RpcException(new Status(StatusCode.InvalidArgument, "File metadata is missing. Send message of type 'FileMetadata' first."));
            }
        }
Ejemplo n.º 2
0
        private void EnsureFilePayloadWasSent(IAsyncStreamReader <StartUploadRequest> requestStream)
        {
            StartUploadRequest.UploadRequestOneofCase requesttype = requestStream.Current.UploadRequestCase;

            if (requesttype == StartUploadRequest.UploadRequestOneofCase.FileMetadata)
            {
                throw new RpcException(new Status(StatusCode.InvalidArgument, "File metadata is was already sent. Only payload is accepted"));
            }
        }