示例#1
0
        public static ScoreSnapshotDetail Create(Guid snapshotId, string snapshotName, DynamoDbScore score, Dictionary <string, string> hashSet)
        {
            if (score.Type != DynamoDbScoreTypes.Main)
            {
                throw new ArgumentException(nameof(score));
            }

            var data = ScoreData.Create(score.Data);

            return(new ScoreSnapshotDetail()
            {
                Id = snapshotId,
                Name = snapshotName,
                Data = data,
                HashSet = hashSet.ToDictionary(x => x.Key, x => x.Value),
            });
        }
示例#2
0
        public static ScoreDetail Create(DynamoDbScore score, Dictionary <string, string> hashSet)
        {
            if (score.Type != DynamoDbScoreTypes.Main)
            {
                throw new ArgumentException(nameof(score));
            }

            var data = ScoreData.Create(score.Data);

            return(new ScoreDetail()
            {
                CreateAt = ScoreDatabaseUtils.ConvertFromUnixTimeMilli(score.CreateAt),
                UpdateAt = ScoreDatabaseUtils.ConvertFromUnixTimeMilli(score.UpdateAt),
                DataHash = score.DataHash,
                Data = data,
                Access = ScoreDatabaseUtils.ConvertToScoreAccess(score.Access),
                HashSet = hashSet.ToDictionary(x => x.Key, x => x.Value),
            });
        }