public async Task <IActionResult> ExecuteAsync()
        {
            try
            {
                var entity = await _Writer.ExecuteAsync();

                var result = new EnrollmentResponse
                {
                    ConfirmationKey   = Convert.ToBase64String(entity.ConfirmationKey),
                    BucketId          = Convert.ToBase64String(entity.BucketId),
                    LabConfirmationId = _LabConfirmationIdFormatter.Format(entity.LabConfirmationId), //Architects choice to use UI format in response.
                    Validity          = _WorkflowTime.TimeToLiveSeconds(_UtcDateTimeProvider.Snapshot, entity.ValidUntil)
                };

                return(new OkObjectResult(result));
            }
            catch (Exception ex)
            {
                _Logger.WriteFailed(ex);
                return(new OkObjectResult(new EnrollmentResponse {
                    Validity = -1
                }));
            }
            finally
            {
                _Logger.WriteFinished();
            }
        }
        public async Task <IActionResult> Execute()
        {
            try
            {
                var entity = await _Writer.Execute();

                var result = new EnrollmentResponse
                {
                    ConfirmationKey = Convert.ToBase64String(entity.ConfirmationKey),
                    BucketId        = Convert.ToBase64String(entity.BucketId),
                    //TODO remove formatting when spec is clarified to remove UI concern from data.
                    LabConfirmationId = _LabConfirmationIdFormatter.Format(entity.LabConfirmationId),
                    Validity          = _WorkflowTime.TimeToLiveSeconds(_UtcDateTimeProvider.Snapshot, entity.ValidUntil)
                };

                return(new OkObjectResult(result));
            }
            catch (Exception ex)
            {
                //TODO: check if you want to use Serilog's Exception logging, or just use ToString
                _Logger.LogError(ex.ToString());
                return(new OkObjectResult(new EnrollmentResponse {
                    Validity = -1
                }));
            }
        }