79309223

Date: 2024-12-26 10:21:50
Score: 0.5
Natty:
Report link

If you only want to update existing key without creating one:

if (_store.ContainsKey(book.id))
{
    _store[book.id] = book;
}

If you want to add or update existing:

if (!_store.TryAdd(book.id, book))
{
    _store[book.id] = book;
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Evgeny Sobolev