Esempio n. 1
0
        async Task PutScoreAsync(
            Guid ownerId,
            Guid newScoreId,
            int maxCount,
            string title,
            string description,
            DateTimeOffset now)
        {
            var client    = _dynamoDbClient;
            var tableName = ScoreTableName;

            var scorePartitionKey = PartitionPrefix.Score + _commonLogic.ConvertIdFromGuid(ownerId);
            var newScore          = _commonLogic.ConvertIdFromGuid(newScoreId);

            var createAt = now.ToUnixTimeMilliseconds();
            var updateAt = createAt;

            var newLockSummary      = _commonLogic.NewGuid();
            var newLockSummaryValue = _commonLogic.ConvertIdFromGuid(newLockSummary);

            var newLockMainValue = _commonLogic.NewLock();

            var actions = new List <TransactWriteItem>()
            {
                new()
                {
                    Update = new Update()
                    {
                        Key = new Dictionary <string, AttributeValue>()
                        {
Esempio n. 2
0
        public async Task UpdateTitleAsync(Guid ownerId, Guid scoreId, string title)
        {
            var partitionKey = "sc:" + _commonLogic.ConvertIdFromGuid(ownerId);
            var sortKey      = _commonLogic.ConvertIdFromGuid(scoreId);


            var newLockValue = _commonLogic.NewLock();
            var now          = _commonLogic.Now;
            var at           = now.ToUnixTimeMilliseconds();

            var request = new UpdateItemRequest()
            {
                Key = new Dictionary <string, AttributeValue>()
                {