public async Task <IAsyncResult> GenerateObservers([FromForm] int count)
        {
            if (!ControllerExtensions.ValidateGenerateObserversNumber(count))
            {
                return(Task.FromResult(new BadRequestObjectResult("Incorrect parameter supplied, please check that paramter is between boundaries: "
                                                                  + ControllerExtensions.LOWER_OBS_VALUE + " - " + ControllerExtensions.UPPER_OBS_VALUE)));
            }

            ObserverGenerateCommand command = new ObserverGenerateCommand(count,
                                                                          ControllerExtensions.GetIdOngOrDefault(this, 0));

            var result = _mediator.Send(command);

            return(Task.FromResult(new OkObjectResult(result.Result)));
        }
        public async Task <IAsyncResult> Reset([FromForm] string action, [FromForm] string phoneNumber)
        {
            if (String.IsNullOrEmpty(action) || String.IsNullOrEmpty(phoneNumber))
            {
                return(Task.FromResult(BadRequest()));
            }

            if (String.Equals(action, ControllerExtensions.DEVICE_RESET))
            {
                var result = await _mediator.Send(new ResetDeviceCommand(ControllerExtensions.GetIdOngOrDefault(this, 0), phoneNumber));

                if (result == -1)
                {
                    return(Task.FromResult(NotFound(ControllerExtensions.RESET_ERROR_MESSAGE + phoneNumber)));
                }
                else
                {
                    return(Task.FromResult(Ok(result)));
                }
            }

            if (String.Equals(action, ControllerExtensions.PASSWORD_RESET))
            {
                var result = await _mediator.Send(new ResetPasswordCommand(ControllerExtensions.GetIdOngOrDefault(this, 0), phoneNumber));

                if (String.IsNullOrEmpty(result))
                {
                    return(Task.FromResult(NotFound(ControllerExtensions.RESET_ERROR_MESSAGE + phoneNumber)));
                }
                else
                {
                    return(Task.FromResult(Ok(result)));
                }
            }

            return(Task.FromResult(UnprocessableEntity()));
        }