public async Task <TekReleaseWorkflowStateEntity> ExecuteAsync()
        {
            var entity = new TekReleaseWorkflowStateEntity
            {
                Created    = _DateTimeProvider.Snapshot.Date,
                ValidUntil = _WorkflowTime.Expiry(_DateTimeProvider.Snapshot)
            };
            await _WorkflowDbContext.KeyReleaseWorkflowStates.AddAsync(entity);

            _Logger.WriteWritingStart();

            var success = WriteAttempt(entity);

            while (!success)
            {
                _WorkflowDbContext.BeginTransaction();
                entity = new TekReleaseWorkflowStateEntity
                {
                    Created    = _DateTimeProvider.Snapshot.Date,
                    ValidUntil = _WorkflowTime.Expiry(_DateTimeProvider.Snapshot)
                };
                await _WorkflowDbContext.KeyReleaseWorkflowStates.AddAsync(entity);

                success = WriteAttempt(entity);
            }

            return(entity);
        }
        public async Task <TekReleaseWorkflowStateEntity> ExecuteAsync()
        {
            var entity = await BuildEntityAndAddToContextAsync();

            _logger.WriteWritingStart();

            var success = TryGenerateRemainingFieldsAndWriteToDb(entity);

            while (!success)
            {
                _workflowDbContext.BeginTransaction();
                entity = await BuildEntityAndAddToContextAsync();

                success = TryGenerateRemainingFieldsAndWriteToDb(entity);
            }

            return(entity);
        }