コード例 #1
0
 public async Task ResetJsonPageLockAsync()
 {
     var pk = LockEntity.GeneratePartitionKey();
     await _tableStorage.InsertOrMergeAsync(new LockEntity
     {
         PartitionKey = pk,
         RowKey       = JsonLockKey,
         DateTime     = new DateTime(1601, 1, 1), //Storage Azure can't store less
         ETag         = "*"
     });
 }
コード例 #2
0
 public async Task SetJsonPageLockAsync(string userEmail, string userName, string ipAddress)
 {
     var pk = LockEntity.GeneratePartitionKey();
     await _tableStorage.InsertOrMergeAsync(new LockEntity
     {
         PartitionKey = pk,
         RowKey       = JsonLockKey,
         UserEmail    = userEmail,
         DateTime     = DateTime.UtcNow,
         UserName     = userName,
         IpAddress    = ipAddress,
         ETag         = "*"
     });
 }
コード例 #3
0
        public async Task <ILockEntity> GetJsonPageLockAsync()
        {
            var pk = LockEntity.GeneratePartitionKey();

            return(await _tableStorage.GetDataAsync(pk, JsonLockKey));
        }