Beispiel #1
0
        ///GENMHASH:4BBEC5095F134F13806627750ADC9D39:94AECEF6A2216225A2656ED6B352544E
        public SubnetImpl WithAccessFromService(ServiceEndpointType service)
        {
            if (this.Inner.ServiceEndpoints == null)
            {
                this.Inner.ServiceEndpoints = new List <ServiceEndpointPropertiesFormat>();
            }
            bool found = false;

            foreach (var endpoint in this.Inner.ServiceEndpoints)
            {
                if (endpoint.Service.Equals(service.ToString(), StringComparison.OrdinalIgnoreCase))
                {
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                this.Inner
                .ServiceEndpoints
                .Add(new ServiceEndpointPropertiesFormat
                {
                    Service   = service.ToString(),
                    Locations = new List <string>()
                });
            }
            return(this);
        }
Beispiel #2
0
 ///GENMHASH:4BF88A9FA8C6CBDE8C9FB8F2E36F2042:2364D37AC0E056BCEDF007BC6849ADD1
 public Subnet.Update.IUpdate WithoutAccessFromService(ServiceEndpointType service)
 {
     if (this.Inner.ServiceEndpoints != null)
     {
         int foundIndex = -1;
         int i          = 0;
         foreach (var endpoint in this.Inner.ServiceEndpoints)
         {
             if (endpoint.Service.Equals(service.ToString(), StringComparison.OrdinalIgnoreCase))
             {
                 foundIndex = i;
                 break;
             }
             i++;
         }
         if (foundIndex != -1)
         {
             this.Inner.ServiceEndpoints.RemoveAt(foundIndex);
         }
     }
     return(this);
 }