Esempio n. 1
0
        public void AddPcPartToDb(IProduceable product)
        {
            var pcPart = (PcPart)product;

            pcPart.Id = _storage.PcParts.Count == 0 ? 0 : _storage.PcParts.Max(x => x.Id) + 1;
            _storage.PcParts.Add(pcPart);
            _serializer.SerializeAndSave(_storage);
        }