Beispiel #1
0
        public async Task <IActionResult> Create(CreateWorkflowCommand command)
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();

            if (command.Inputs == null)
            {
                //Set to an empty dictionary if null
                command.Inputs = new Dictionary <string, object>();
            }
            try
            {
                command.CreatedBy = ClaimsUtility.GetId(User);
                var result = await Mediator.Send(command);

                return(Ok(new HttpCommandResult <Workflow>("workflow", result, result.Result)));
            }
            catch (BaseException e)
            {
                Logger.LogError(e.Message);
                stopwatch.Stop();
                return(BadRequest(e.ToExceptionResult(stopwatch.ElapsedMilliseconds)));
            }
        }
Beispiel #2
0
 public async UnaryResult <OperationResult> AddAsync(CreateWorkflowCommand command)
 {
     return(await _mediator.Send(command));
 }
 public async Task <ActionResult <int> > Create(CreateWorkflowCommand command)
 {
     return(await Mediator.Send(command));
 }