Beispiel #1
0
        public async Task SendVoteAsync(string community, string user)
        {
            var voto = new Voto
            {
                Comunidad = community,
                Usuario   = user,
            };

            await _messageQueue.AddMessageAsync(voto.AsQueueMessage());
        }
        public async Task SendVoteAsync(string community, string user)
        {
            var c    = community.ToLowerInvariant();
            var voto = new Voto
            {
                Comunidad = c,
                Usuario   = user,
            };

            await _messageQueue.AddMessageAsync(voto.AsQueueMessage());

            await Task.Run(() =>
            {
                var v = (int)(MemoryCache.Get(c) ?? 0);

                MemoryCache.Set(c, ++v);
            });
        }