public async Task <DeleteStepOptionResponse> Delete(DeleteStepOptionRequest request) { if (!await batchRepository.DoesBatchExist(request.BatchId)) { throw Err.BatchNotFound(request.BatchId); } var step = await stepRepository.Get(request.BatchId, request.StepName); if (step == null) { throw Err.StepNotFound(request.StepName); } var existingStepOption = await stepRepository.GetStepOption(step.Id, request.OptionName); if (existingStepOption == null) { throw Err.StepOptionNotFound(request.OptionName); } await stepRepository.DeleteStepOption(existingStepOption.Id); return(new DeleteStepOptionResponse()); }