This commit is contained in:
@@ -56,7 +56,7 @@ namespace AyaNova.Biz
|
|||||||
var offset = opt.Offset ?? 0;
|
var offset = opt.Offset ?? 0;
|
||||||
|
|
||||||
//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).AsNoTracking();
|
||||||
q = q.Where(m => m.AyId == opt.AyId && m.AyType == opt.AyType);
|
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);
|
||||||
@@ -95,9 +95,14 @@ namespace AyaNova.Biz
|
|||||||
var limit = opt.Limit ?? DEFAULT_EVENT_LIMIT;
|
var limit = opt.Limit ?? DEFAULT_EVENT_LIMIT;
|
||||||
var offset = opt.Offset ?? 0;
|
var offset = opt.Offset ?? 0;
|
||||||
//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.UserId == opt.UserId);
|
||||||
|
// q = q.OrderByDescending(m => m.Created);
|
||||||
|
|
||||||
|
var q = ct.Event.Select(m => m).AsNoTracking();
|
||||||
q = q.Where(m => m.UserId == opt.UserId);
|
q = q.Where(m => m.UserId == opt.UserId);
|
||||||
q = q.OrderByDescending(m => m.Created);
|
q = q.OrderByDescending(m => m.Created);
|
||||||
|
q = q.Skip(offset).Take(limit);
|
||||||
|
|
||||||
|
|
||||||
//Execute the query
|
//Execute the query
|
||||||
@@ -139,7 +144,7 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(ev.Creator, ev.AyId, ev.AyType, AyaEvent.Created, ev.Created, null), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(ev.Creator, ev.AyId, ev.AyType, AyaEvent.Created, ev.Created, null), ct);
|
||||||
|
|
||||||
//MODIFIED
|
//MODIFIED
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(ev.Modifier,ev.AyId, ev.AyType, AyaEvent.Modified, ev.Modified, null), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(ev.Modifier, ev.AyId, ev.AyType, AyaEvent.Modified, ev.Modified, null), ct);
|
||||||
|
|
||||||
|
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user