예제 #1
0
        public GameUpdate(DateTimeOffset timestamp, JsonElement payload)
        {
            Id      = JsonHash.HashHex(payload);
            Payload = BsonDocument.Parse(payload.GetRawText());

            FirstSeen = timestamp;
            LastSeen  = timestamp;

            var gameId = Payload.GetGameId();

            if (gameId == null)
            {
                throw new ArgumentException("Could not extract game ID from payload");
            }

            GameId = gameId.Value;
        }