Beispiel #1
0
 public string GetMappedSubscription(SubscriptionMapping mapping)
 {
     if (mapping == null)
     {
         throw new ArgumentNullException(nameof(mapping));
     }
     return(null);
 }
Beispiel #2
0
        private static void AssertValidMapping(string hostName, IEnumerable <SubscriptionMapping> namespaceMappings,
                                               SubscriptionMapping mapping)
        {
            var matchingMapping = namespaceMappings.FirstOrDefault(m =>
                                                                   m.HostItemName == mapping.HostItemName &&
                                                                   m.SubscriptionName == mapping.SubscriptionName);

            if (matchingMapping != null)
            {
                throw new InvalidOperationException(
                          $"A mapping for the Subscription: {matchingMapping.SubscriptionName} on Host Item: {matchingMapping.HostItemName} " +
                          $"defined within the Host: {hostName} is already mapped to Subscription: {matchingMapping.MappedSubscriptionName}");
            }
        }
Beispiel #3
0
        public string GetMappedSubscription(SubscriptionMapping mapping)
        {
            if (mapping == null)
            {
                throw new ArgumentNullException(nameof(mapping));
            }

            if (!_mappings.TryGetValue(mapping.HostName, out List <SubscriptionMapping> nsMappings))
            {
                return(null);
            }

            var subscriptionMapping = nsMappings.FirstOrDefault(m =>
                                                                m.HostItemName == mapping.HostItemName && m.SubscriptionName == mapping.SubscriptionName);

            return(subscriptionMapping?.MappedSubscriptionName);
        }