public async Task <IActionResult> Delete(
            [HttpTrigger(AuthorizationLevel.Function, "delete", Route = "data/providerData/{providerDataId}")] HttpRequest httpRequest,
            string providerDataId)
        {
            if (httpRequest is null)
            {
                throw new ArgumentNullException(nameof(httpRequest));
            }

            if (providerDataId is null)
            {
                throw new ArgumentNullException(nameof(providerDataId));
            }

            var providerData = await providerDataRepository
                               .GetAsync(providerDataId)
                               .ConfigureAwait(false);

            if (providerData is null)
            {
                return(new NotFoundResult());
            }

            await providerDataRepository
            .RemoveAsync(providerData)
            .ConfigureAwait(false);

            return(new OkObjectResult(providerData));
        }
        public async Task <ICommandResult> HandleAsync(OrchestratorProviderDataDeleteCommand orchestratorCommand, IDurableClient durableClient = null)
        {
            if (orchestratorCommand is null)
            {
                throw new ArgumentNullException(nameof(orchestratorCommand));
            }

            var commandResult = orchestratorCommand.CreateResult();

            try
            {
                commandResult.Result = await providerDataRepository
                                       .RemoveAsync(orchestratorCommand.Payload)
                                       .ConfigureAwait(false);

                commandResult.RuntimeStatus = CommandRuntimeStatus.Completed;
            }
            catch (Exception exc)
            {
                commandResult.Errors.Add(exc);
            }

            return(commandResult);
        }