public async Task <DateTimeOffset?> GetAsync()
        {
            var lastUpdateTimestampStr = await _stateEntryRepository.GetValueAsync(LastUpdateTimeKey);

            if (!long.TryParse(lastUpdateTimestampStr, out var lastUpdateTimestamp) || lastUpdateTimestamp <= 0)
            {
                return(default);
Пример #2
0
        public async Task <Guid> GetOrCreateAsync()
        {
            var stringId = await _stateEntryRepository.GetValueAsync(LoopIdKey);

            if (stringId is not null)
            {
                return(Guid.Parse(stringId));
            }

            var id = _guidProvider.Create();

            await StoreInternalAsync(id);

            return(id);
        }