public Task <ICommandResult> HandleAsync(OrganizationDeleteCommand command, IAsyncCollector <ICommand> commandQueue, IDurableOrchestrationContext orchestrationContext, ILogger log)
    {
        if (command is null)
        {
            throw new ArgumentNullException(nameof(command));
        }

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

        throw new NotSupportedException();

        // var commandResult = orchestratorCommand.CreateResult();

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

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

        // return commandResult;
    }
Example #2
0
    public Task <IActionResult> Delete([FromRoute] string organizationId) => WithContextAsync <Organization>(async(contextUser, organization) =>
    {
        var command = new OrganizationDeleteCommand(contextUser, organization);

        return(await Orchestrator
               .InvokeAndReturnActionResultAsync(command, Request)
               .ConfigureAwait(false));
    });