Ejemplo n.º 1
0
        public IPeripheral RemovePeripheral(string peripheralType)
        {
            if (Peripherals.All(x => x.GetType().Name != peripheralType))
            {
                throw new ArgumentException(string.Format(ExceptionMessages.NotExistingPeripheral, peripheralType, GetType().Name, Id));
            }
            IPeripheral peripheralRemove = Peripherals.First(x => x.GetType().Name == peripheralType);

            peripherals.Remove(peripheralRemove);
            return(peripheralRemove);
        }