public async Task <CreateStepResponse> Post(CreateStepRequest request) { if (!await batchRepository.DoesBatchExist(request.BatchId)) { throw Err.BatchNotFound(request.BatchId); } if (await stepRepository.DoesStepExist(request.BatchId, request.StepName)) { throw Err.StepAlreadyExists(request.StepName); } var step = request.ConvertTo <Step>(); await stepRepository.Create(step); return(new CreateStepResponse()); }