Files
PaymentLogs/sql2/Repositories/Repo.cs
T
2024-05-23 23:21:24 +03:00

27 lines
614 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PaymentLogs.Repositories
{
internal abstract class Repo<K, V>
{
protected Dictionary<K, V> _data = new Dictionary<K, V>();
public abstract void Load();
public virtual List<V> All()
{
return _data.Values.ToList();
}
public virtual V Get(K key) { return _data[key]; }
public virtual void Update(K key, V value)
{
_data[key] = value;
}
public abstract void Save();
}
}