Fixed AutoSavedStore's deletion of data when table was using composite keys.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
using HermesSocketLibrary.db;
|
||||
using HermesSocketServer.Models;
|
||||
using HermesSocketServer.Messages;
|
||||
using HermesSocketServer.Store.Internal;
|
||||
|
||||
namespace HermesSocketServer.Store
|
||||
{
|
||||
public class PolicyStore : AutoSavedStore<string, PolicyMessage>
|
||||
public class PolicyStore : AutoSavedStore<string, Policy>
|
||||
{
|
||||
private readonly string _userId;
|
||||
private readonly Database _database;
|
||||
@@ -26,7 +26,7 @@ namespace HermesSocketServer.Store
|
||||
await _database.Execute(sql, data, (reader) =>
|
||||
{
|
||||
var id = reader.GetGuid(0);
|
||||
_store.Add(id.ToString(), new PolicyMessage()
|
||||
_store.Add(id.ToString(), new Policy()
|
||||
{
|
||||
Id = id,
|
||||
UserId = _userId,
|
||||
@@ -39,15 +39,15 @@ namespace HermesSocketServer.Store
|
||||
_logger.Information($"Loaded {_store.Count} policies from database.");
|
||||
}
|
||||
|
||||
protected override void OnInitialAdd(string key, PolicyMessage value)
|
||||
protected override void OnInitialAdd(string key, Policy value)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnInitialModify(string key, PolicyMessage value)
|
||||
protected override void OnInitialModify(string key, Policy value)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnInitialRemove(string key)
|
||||
protected override void OnPostRemove(string key, Policy value)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user