public async Task <CreateBatchArtifactResponse> Post(CreateBatchArtifactRequest request) { if (!await batchRepository.DoesBatchExist(request.BatchId)) { throw Err.BatchNotFound(request.BatchId); } if (await batchRepository.DoesBatchArtifactExist(request.BatchId, request.ArtifactName)) { throw Err.BatchArtifactAlreadyExists(request.ArtifactName); } var batchArtifact = request.ConvertTo <BatchArtifact>(); await batchRepository.CreateBatchArtifact(batchArtifact); return(new CreateBatchArtifactResponse()); }