This commit is contained in:
2020-04-10 19:48:35 +00:00
parent 34708e7e2e
commit a868018ecf
3 changed files with 34 additions and 17 deletions

View File

@@ -61,15 +61,20 @@ namespace AyaNova.Biz
var EventItems = await q.ToArrayAsync();
//convert the Event array to the correct return type array
var ret = EventItems.Select(m => new AyaNova.Api.Controllers.EventLogController.ObjectEventLogItem()
using (var command = ct.Database.GetDbConnection().CreateCommand())
{
Date = m.Created,
UserId = m.UserId,
Event = m.AyEvent,
Textra = m.Textra
}).ToArray();
ct.Database.OpenConnection();
var ret = EventItems.Select(m => new AyaNova.Api.Controllers.EventLogController.ObjectEventLogItem()
{
Date = m.Created,
UserId = m.UserId,
Event = m.AyEvent,
Textra = m.Textra,
Name = BizObjectNameFetcherDirect.Name(AyaType.User, m.UserId, command)
}).ToArray();
return ret;
return ret;
}
}
@@ -91,18 +96,24 @@ namespace AyaNova.Biz
//Execute the query
var EventItems = await q.ToArrayAsync();
//convert the Event array to the correct return type array
var ret = EventItems.Select(m => new AyaNova.Api.Controllers.EventLogController.UserEventLogItem()
using (var command = ct.Database.GetDbConnection().CreateCommand())
{
Date = m.Created,
ObjectType = m.AyType,
ObjectId = m.AyId,
Event = m.AyEvent,
Textra = m.Textra
}).ToArray();
ct.Database.OpenConnection();
//convert the Event array to the correct return type array
var ret = EventItems.Select(m => new AyaNova.Api.Controllers.EventLogController.UserEventLogItem()
{
Date = m.Created,
ObjectType = m.AyType,
ObjectId = m.AyId,
Event = m.AyEvent,
Textra = m.Textra,
Name = BizObjectNameFetcherDirect.Name(m.AyType, m.AyId, command)
}).ToArray();
return ret;
}
return ret;
}