This commit is contained in:
2020-01-22 16:24:39 +00:00
parent 8267365370
commit 070688265b
18 changed files with 92 additions and 54 deletions

View File

@@ -13,7 +13,7 @@ namespace AyaNova.Biz
{
internal static class EventLogProcessor
{
/// <summary>
/// Add an entry to the log
///
@@ -21,13 +21,13 @@ namespace AyaNova.Biz
/// <param name="newEvent"></param>
/// <param name="ct"></param>
/// <returns></returns>
internal static void LogEventToDatabase(Event newEvent, AyContext ct)
internal static void LogEventToDatabaseAndSaveEntireContext(Event newEvent, AyContext ct)
{
ct.Event.Add(newEvent);
ct.SaveChanges();
ct.Event.Add(newEvent);
ct.SaveChanges();
}
/// <summary>
/// Handle delete
@@ -41,7 +41,7 @@ namespace AyaNova.Biz
internal static void DeleteObject(long userId, AyaType ayType, long ayId, string textra, AyContext ct)
{
ct.Database.ExecuteSqlInterpolated($"delete from aevent where aytype = {ayType} and ayid={ayId}");
ct.Event.Add(new Event(userId, ayId, ayType, AyaEvent.Deleted, textra));
ct.Event.Add(new Event(userId, ayId, ayType, AyaEvent.Deleted, textra));
}
/// <summary>