public async Task <IToken> GetAsync(string tokenId) { var pk = TokenEntity.GeneratePartitionKey(); var rk = TokenEntity.GenerateRowKey(tokenId); return(await _tableStorage.GetDataAsync(pk, rk)); }
public async Task SaveTokenAsync(IToken token) { var ts = token as TokenEntity; if (ts == null) { ts = (TokenEntity) await GetAsync(token.RowKey) ?? new TokenEntity(); ts.ETag = token.ETag; ts.AccessList = token.AccessList; ts.IpList = token.IpList; } ts.PartitionKey = TokenEntity.GeneratePartitionKey(); ts.RowKey = token.RowKey; await _tableStorage.InsertOrMergeAsync(ts); }
public async Task RemoveTokenAsync(string tokenId) { var pk = TokenEntity.GeneratePartitionKey(); await _tableStorage.DeleteAsync(pk, tokenId); }
public async Task <IEnumerable <IToken> > GetAllAsync() { var pk = TokenEntity.GeneratePartitionKey(); return(await _tableStorage.GetDataAsync(pk)); }