public void AddRoutingInstance(RoutingInstance routingInstance) { if (this.RoutingInstances.Contains(routingInstance)) { throw new SigmaDomainException($"Routing instance '{routingInstance.Name}' already exists for device '{this.Name}'."); } this._routingInstances.Add(routingInstance); }
public Uni(Device device, List <Port> ports, RoutingInstance routingInstance = null, int?tenantId = null) { this.Name = Guid.NewGuid().ToString("N"); this._device = device ?? throw new ArgumentNullException(nameof(device)); this._ports = ports ?? throw new ArgumentNullException(nameof(ports)); this.RoutingInstance = routingInstance; this._tenantId = tenantId; }
protected Device() { _ports = new List <Port>(); _routingInstances = new List <RoutingInstance>(); var defaultRoutingInstance = new RoutingInstance(this, RoutingInstanceType.Default, "Default"); this.AddRoutingInstance(defaultRoutingInstance); }