コード例 #1
0
        public async Task <BatchResponse> BatchAsync([FromBody] BatchRequest request)
        {
            if (request.Operation == LfsOperation.Upload)
            {
                return(new BatchResponse
                {
                    Transfer = request.Transfers.First(),
                    Objects = await objectManager.UploadObjects(request.Objects, GenerateTimeoutToken())
                              .ConfigureAwait(false)
                });
            }

            if (request.Operation == LfsOperation.Download)
            {
                return(new BatchResponse
                {
                    Transfer = request.Transfers.First(),
                    Objects = await objectManager.DownloadObjects(request.Objects, GenerateTimeoutToken())
                              .ConfigureAwait(false)
                });
            }

            throw new Exception("Method not implemented");
        }