internal void Replace(IfcNamedUnit unit) { IfcNamedUnit existing = mUnits.OfType <IfcNamedUnit>().Where(x => x.UnitType == unit.UnitType).FirstOrDefault(); if (existing != null) { mUnits.Remove(existing); } Units.Add(unit); }