public async Task StoreNewVerificationRequest(VerificationRequest verificationRequest) { var entity = new VerificationRequestEntity(verificationRequest); var table = await this.GetTableAsync(); await table.ExecuteAsync(TableOperation.InsertOrReplace(entity)); }
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)); }