예제 #1
0
        public async Task StoreNewVerificationRequest(VerificationRequest verificationRequest)
        {
            var entity = new VerificationRequestEntity(verificationRequest);

            var table = await this.GetTableAsync();

            await table.ExecuteAsync(TableOperation.InsertOrReplace(entity));
        }
예제 #2
0
        public async Task UpdateAttemptedRequest(VerificationRequest storedCodeRequest)
        {
            var table = await this.GetTableAsync();

            var existingEntry = await table.ExecuteAsync(TableOperation.Retrieve(storedCodeRequest.UserId, storedCodeRequest.VerificationType.ToString()));

            if (existingEntry == null)
            {
                throw new EntityNotFoundException();
            }

            var entity = new VerificationRequestEntity(storedCodeRequest)
            {
                ETag = existingEntry.Etag,
            };

            await table.ExecuteAsync(TableOperation.Replace(entity));
        }