Exemplo n.º 1
0
        public async Task <ICommandResult> HandleAsync(OrchestratorProjectLinkUpdateCommand orchestratorCommand)
        {
            var commandResult = orchestratorCommand.CreateResult();

            try
            {
                commandResult.Result = await projectLinkRepository
                                       .SetAsync(orchestratorCommand.Payload)
                                       .ConfigureAwait(false);

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

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

            var commandResult = orchestratorCommand.CreateResult();

            try
            {
                commandResult.Result = await projectLinkRepository
                                       .SetAsync(orchestratorCommand.Payload)
                                       .ConfigureAwait(false);

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

            return(commandResult);
        }