Пример #1
0
        DispatcherData ToDispatcherData(Request request)
        {
            MessageEntity message = new MessageEntity()
            {
                InOrOut     = "I",
                IsActive    = true,
                Message     = request.Message,
                CreatedTime = DateTime.Now
            };

            _context.Add(message);

            return(new DispatcherData(request.Message, request.AssemblyName, request.ClassName));
        }
Пример #2
0
        private async Task RegisterPageResults(EndedEventsPage eep)
        {
            if (eep?.Results == null)
            {
                return;
            }

            foreach (var result in eep.Results)
            {
                var containsGame = await _dbContext.Games.AnyAsync(g => g.Id == result.Id);

                if (containsGame)
                {
                    continue;
                }

                var game = await ExtractGameFromResult(result);

                if (game == null)
                {
                    continue;
                }

                Console.WriteLine($"Adding game with Id: {game.Id}");
                _dbContext.Add(game);
            }

            await _dbContext.SaveChangesAsync();
        }