public void AddPassengerNode(Passenger passenger, Node node) { var passengerNode = GetPassengerNode(passenger); if (passengerNode != null) { throw new InvalidOperationException($"Node already exists for passenger [{passenger.UserId}]"); } _passengerNodes.Add(PassengerNode.Create(node, passenger)); }
public void AddPassengerNode(Passenger passenger, Node node) { var passengerNode = _passengerNodes.SingleOrDefault(x => x.Passenger.UserId == passenger.UserId); if (passengerNode != null) { throw new InvalidOperationException($"Node already exist for passenger: '{passenger.UserId}'."); } _passengerNodes.Add(PassengerNode.Create(passenger, node)); }
public void AddPassengerNode(Passenger passenger, Node node) { var passengerNode = GetPassengerNode(passenger); if (passengerNode != null) { throw new InvalidOperationException($"Node actually exist for passenger {passenger.UserId}"); } _passengerNodes.Add(PassengerNode.Create(passenger, node)); }