/// <summary> /// Removes the consent for a subject and client /// </summary> /// <param name="subject">The subject</param> /// <param name="client">The client</param> /// <returns></returns> public async Task RevokeAsync(string subject, string client) { var entity = new ConsentEntity { PartitionKey = subject, RowKey = client, ETag = "*" }; var op = TableOperation.Delete(entity); await _table.Value.ExecuteAsync(op); }
/// <summary> /// Updates the consent for a subject and client. /// </summary> /// <param name="consent">The consent</param> /// <returns></returns> public async Task UpdateAsync(Consent consent) { var entity = new ConsentEntity { PartitionKey = consent.Subject, RowKey = consent.ClientId, Scopes = string.Join(",", consent.Scopes) }; var op = TableOperation.InsertOrReplace(entity); await _retryHelper.Try(() => _table.Value.ExecuteAsync(op)).UntilNoException(); }
/// <summary> /// Removes the consent for a subject and client /// </summary> /// <param name="subject">The subject</param> /// <param name="client">The client</param> /// <returns></returns> public async Task RevokeAsync(string subject, string client) { var entity = new ConsentEntity { PartitionKey = subject, RowKey = client, ETag = "*" }; var op = TableOperation.Delete(entity); await _retryHelper.Try(() => _table.Value.ExecuteAsync(op)).UntilNoException(); }
/// <summary> /// Updates the consent for a subject and client. /// </summary> /// <param name="consent">The consent</param> /// <returns></returns> public async Task UpdateAsync(Consent consent) { var entity = new ConsentEntity { PartitionKey = consent.Subject, RowKey = consent.ClientId, Scopes = string.Join(",",consent.Scopes) }; var op = TableOperation.InsertOrReplace(entity); await _table.Value.ExecuteAsync(op); }