public Task Unsubscribe(string endpointName, Type eventType, CancellationToken cancellationToken = default) { (_, CloudTable table) = storageAddressingSettings.GetSubscriptionTable(eventType); var operation = TableOperation.Delete(new SubscriptionEntity { Topic = TopicName.From(eventType), Endpoint = endpointName, ETag = "*" }); return(table.ExecuteAsync(operation, cancellationToken)); }
public Task Subscribe(string endpointName, string endpointAddress, Type eventType, CancellationToken cancellationToken = default) { (string alias, CloudTable table) = storageAddressingSettings.GetSubscriptionTable(eventType); var address = new QueueAddress(endpointAddress, alias); var operation = TableOperation.InsertOrReplace(new SubscriptionEntity { Topic = TopicName.From(eventType), Endpoint = endpointName, Address = address.ToString() }); return(table.ExecuteAsync(operation, cancellationToken)); }