replace method
Replace.
Implementation
@override
void replace(String id, NmZone record, NmTelecomL10n l10n) {
final index = _records.indexWhere((item) => item.id == id);
if (index < 0) throw NmZoneRepositoryException(l10n.zoneErrNotFound(id));
if (record.id != id) {
throw NmZoneRepositoryException(l10n.zoneErrIdImmutable);
}
final next = List<NmZone>.of(_records);
next[index] = record;
_records = next;
}