Esempio n. 1
0
        public async Task <int> GetPollId(Poll poll, CancellationToken cancellationToken = default)
        {
            var nextId = poll.Id = await myContext.GetNextPollId(cancellationToken);

            using (var entry = myMemoryCache.CreateEntry(this[nextId]))
            {
                entry.Value = poll;
                entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(3);
            }

            return(nextId);
        }