Esempio n. 1
0
 public static void RemoveServicePortsWithoutBindings(this ServiceDescription sd)
 {
     foreach (var service in sd.GetServices().ToList())
     {
         foreach (var port in service.Ports.Cast <Port>().ToList())
         {
             var bindingNames = sd.GetBindings().Select(c => c.Name).ToList();
             if (!bindingNames.Contains(port.Binding.Name))
             {
                 service.Ports.Remove(port);
             }
         }
     }
 }