2025-01-13 02:19:41 +03:00
|
|
|
using System.Collections.Concurrent;
|
2024-04-16 18:29:40 +00:00
|
|
|
using System.Text.Json.Serialization;
|
2023-08-12 19:08:38 +01:00
|
|
|
|
|
|
|
namespace LootDumpProcessor.Storage.Collections;
|
|
|
|
|
2025-01-13 02:19:41 +03:00
|
|
|
public class FlatKeyableDictionary<K, V> : ConcurrentDictionary<K, V>, IKeyable
|
2023-08-12 19:08:38 +01:00
|
|
|
{
|
2025-01-11 11:50:02 +03:00
|
|
|
[JsonPropertyName("__id__")] private string Id { get; set; }
|
2023-08-12 19:08:38 +01:00
|
|
|
|
2025-01-11 11:50:02 +03:00
|
|
|
public FlatKeyableDictionary(string id)
|
|
|
|
{
|
|
|
|
ArgumentException.ThrowIfNullOrWhiteSpace(id);
|
|
|
|
Id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public IKey GetKey() => new FlatUniqueKey([Id]);
|
2023-08-12 19:08:38 +01:00
|
|
|
}
|