changed all lambda experssion variables to z from various where appropriate

This commit is contained in:
2020-05-18 19:42:42 +00:00
parent 3a359f1052
commit fd8c489914
65 changed files with 431 additions and 557 deletions

View File

@@ -56,9 +56,9 @@ namespace AyaNova.Biz
var offset = opt.Offset ?? 0;
//Set up the query
var q = ct.Event.Select(m => m).AsNoTracking();
q = q.Where(m => m.AyId == opt.AyId && m.AyaType == opt.AyaType);
q = q.OrderByDescending(m => m.Created);
var q = ct.Event.Select(z => z).AsNoTracking();
q = q.Where(z => z.AyId == opt.AyId && z.AyaType == opt.AyaType);
q = q.OrderByDescending(z => z.Created);
q = q.Skip(offset).Take(limit);
//Execute the query
@@ -68,13 +68,13 @@ namespace AyaNova.Biz
using (var command = ct.Database.GetDbConnection().CreateCommand())
{
ct.Database.OpenConnection();
ret.Events = EventItems.Select(m => new AyaNova.Api.Controllers.EventLogController.ObjectEventLogItem()
ret.Events = EventItems.Select(z => 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)
Date = z.Created,
UserId = z.UserId,
Event = z.AyEvent,
Textra = z.Textra,
Name = BizObjectNameFetcherDirect.Name(AyaType.User, z.UserId, command)
}).ToArray();
ret.Name = BizObjectNameFetcherDirect.Name(opt.AyaType, opt.AyId, command);
@@ -95,13 +95,11 @@ namespace AyaNova.Biz
var limit = opt.Limit ?? DEFAULT_EVENT_LIMIT;
var offset = opt.Offset ?? 0;
//Set up the query
// 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.OrderByDescending(m => m.Created);
var q = ct.Event.Select(z => z).AsNoTracking();
q = q.Where(z => z.UserId == opt.UserId);
q = q.OrderByDescending(z => z.Created);
q = q.Skip(offset).Take(limit);
@@ -111,15 +109,15 @@ namespace AyaNova.Biz
{
ct.Database.OpenConnection();
//convert the Event array to the correct return type array
ret.Events = EventItems.Select(m => new AyaNova.Api.Controllers.EventLogController.UserEventLogItem()
ret.Events = EventItems.Select(z => new AyaNova.Api.Controllers.EventLogController.UserEventLogItem()
{
Date = m.Created,
ObjectType = m.AyaType,
ObjectId = m.AyId,
Event = m.AyEvent,
Textra = m.Textra,
Name = BizObjectNameFetcherDirect.Name(m.AyaType, m.AyId, command)
Date = z.Created,
ObjectType = z.AyaType,
ObjectId = z.AyId,
Event = z.AyEvent,
Textra = z.Textra,
Name = BizObjectNameFetcherDirect.Name(z.AyaType, z.AyId, command)
}).ToArray();
ret.Name = BizObjectNameFetcherDirect.Name(AyaType.User, opt.UserId, command);