public async Task <string> VerifyTokenAsync(string token)
        {
            var partitionKey = EmailTokenEntity.GeneratePartitionKeyAsToken(token);

            var entity = (await _tableStorage.GetDataAsync(partitionKey)).FirstOrDefault();

            return(entity?.RowKey);
        }
 public static EmailTokenEntity GenerateTokenIndex(EmailTokenEntity src)
 {
     return(new EmailTokenEntity
     {
         PartitionKey = src.RowKey,
         RowKey = src.PartitionKey
     });
 }
        private async Task <EmailTokenEntity> GetTokenEntity(string email)
        {
            var partitionKey = EmailTokenEntity.GeneratePartitionKey(email);

            var entities = await _tableStorage.GetDataAsync(partitionKey);


            return(entities.FirstOrDefault());
        }
        private async Task <EmailTokenEntity> GenerateNewToken(string email)
        {
            var newEntity = EmailTokenEntity.Create(email);

            await _tableStorage.InsertAsync(newEntity);

            var newIndex = EmailTokenEntity.GenerateTokenIndex(newEntity);

            await _tableStorage.InsertAsync(newIndex);

            return(newEntity);
        }