From() public static méthode

public static From ( Type messageType ) : string
messageType Type
Résultat string
Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }