update test

This commit is contained in:
Shannon
2017-08-10 01:08:29 +10:00
parent 8f121c4d93
commit 2c219576f6
2 changed files with 18 additions and 18 deletions

View File

@@ -992,13 +992,21 @@ order by umbracoNode.{2}, umbracoNode.parentID, umbracoNode.sortOrder",
protected override IEnumerable<IContent> PerformGetAll(params Guid[] ids)
{
var sql = GetBaseQuery(false);
if (ids.Any())
Func<Sql, Sql> translate = s =>
{
sql.Where("umbracoNode.uniqueID in (@ids)", new { ids = ids });
}
if (ids.Any())
{
s.Where("umbracoNode.uniqueID in (@ids)", new { ids });
}
//we only want the newest ones with this method
s.Where<DocumentDto>(x => x.Newest, SqlSyntax);
return s;
};
return _outerRepo.ProcessQuery(sql, new PagingSqlQuery(sql));
var sqlBaseFull = _outerRepo.GetBaseQuery(BaseQueryType.FullMultiple);
var sqlBaseIds = _outerRepo.GetBaseQuery(BaseQueryType.Ids);
return _outerRepo.ProcessQuery(translate(sqlBaseFull), new PagingSqlQuery(translate(sqlBaseIds)));
}
protected override Sql GetBaseQuery(bool isCount)

View File

@@ -576,21 +576,13 @@ namespace Umbraco.Core.Persistence.Repositories
protected override IEnumerable<IMedia> PerformGetAll(params Guid[] ids)
{
Func<Sql, Sql> translate = s =>
var sql = GetBaseQuery(false);
if (ids.Any())
{
if (ids.Any())
{
s.Where("umbracoNode.uniqueID in (@ids)", new { ids });
}
//we only want the newest ones with this method
s.Where<DocumentDto>(x => x.Newest, SqlSyntax);
return s;
};
sql.Where("umbracoNode.uniqueID in (@ids)", new { ids = ids });
}
var sqlBaseFull = _outerRepo.GetBaseQuery(BaseQueryType.FullMultiple);
var sqlBaseIds = _outerRepo.GetBaseQuery(BaseQueryType.Ids);
return _outerRepo.ProcessQuery(translate(sqlBaseFull), new PagingSqlQuery(translate(sqlBaseIds)));
return _outerRepo.ProcessQuery(sql, new PagingSqlQuery(sql));
}
protected override Sql GetBaseQuery(bool isCount)