This commit is contained in:
@@ -19,6 +19,8 @@ namespace AyaNova.Biz
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal static async Task LogEventToDatabaseAsync(Event newEvent, AyContext ct)
|
internal static async Task LogEventToDatabaseAsync(Event newEvent, AyContext ct)
|
||||||
{
|
{
|
||||||
|
//System.Diagnostics.Debug.WriteLine($"Event log event for {newEvent.AyId}:{newEvent.AyType} {newEvent.AyEvent} {newEvent.Created}");
|
||||||
|
|
||||||
await ct.Event.AddAsync(newEvent);
|
await ct.Event.AddAsync(newEvent);
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
@@ -54,7 +56,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
//Set up the query
|
//Set up the query
|
||||||
var q = ct.Event.Select(m => m).Skip(offset).Take(limit).AsNoTracking();
|
var q = ct.Event.Select(m => m).Skip(offset).Take(limit).AsNoTracking();
|
||||||
q = q.Where(m => m.AyId == opt.AyId);
|
q = q.Where(m => m.AyId == opt.AyId && m.AyType== opt.AyType);
|
||||||
q = q.OrderByDescending(m => m.Created);
|
q = q.OrderByDescending(m => m.Created);
|
||||||
q = q.Skip(offset).Take(limit);
|
q = q.Skip(offset).Take(limit);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user