Microsoft.AspNet.WebHooks.WebHookReceiverConfig.GetReceiverConfigAsync C# (CSharp) Method

GetReceiverConfigAsync() public method

public GetReceiverConfigAsync ( string name, string id ) : Task
name string
id string
return Task
        public virtual Task<string> GetReceiverConfigAsync(string name, string id)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (id == null)
            {
                id = string.Empty;
            }

            string key = GetConfigKey(name, id);
            string value;
            string result = _config.TryGetValue(key, out value) ? value : null;
            return Task.FromResult(result);
        }

Usage Example

Beispiel #1
0
        public async Task GetReceiverConfigAsync_Returns_ExpectedValue(IDictionary <string, string> input, string receiver, string id, string expected)
        {
            // Arrange
            SettingsDictionary    settings = GetSettings(input);
            WebHookReceiverConfig config   = new WebHookReceiverConfig(settings, _logger);

            // Act
            string actual = await config.GetReceiverConfigAsync(receiver, id);

            // Assert
            Assert.Equal(expected, actual);
        }
All Usage Examples Of Microsoft.AspNet.WebHooks.WebHookReceiverConfig::GetReceiverConfigAsync