Changes Set to Populate, changes Fetch to Query and makes GetById public

This commit is contained in:
Shannon
2018-03-21 11:31:30 +11:00
parent af0a03a3e0
commit ff31cd9f72
5 changed files with 6 additions and 6 deletions

View File

@@ -69,7 +69,7 @@ namespace Umbraco.Core.Services
_dictionary[umbracoObjectType] = (id2key, key2id);
}
internal void Set(IEnumerable<(int id, Guid key)> pairs, UmbracoObjectTypes umbracoObjectType)
internal void Populate(IEnumerable<(int id, Guid key)> pairs, UmbracoObjectTypes umbracoObjectType)
{
try
{
@@ -97,7 +97,7 @@ namespace Umbraco.Core.Services
{
// populate content and media items
var types = new[] { Constants.ObjectTypes.Document, Constants.ObjectTypes.Media };
var values = uow.Database.Fetch<TypedIdDto>("SELECT id, uniqueId, nodeObjectType FROM umbracoNode WHERE nodeObjectType IN @types", new { types });
var values = uow.Database.Query<TypedIdDto>("SELECT id, uniqueId, nodeObjectType FROM umbracoNode WHERE nodeObjectType IN @types", new { types });
foreach (var value in values)
{
var umbracoObjectType = UmbracoObjectTypesExtensions.GetUmbracoObjectType(value.NodeObjectType);

View File

@@ -60,7 +60,7 @@ namespace Umbraco.Web.PublishedCache
// same with Guid
// cannot make this public nor abstract without breaking backward compatibility
protected virtual IPublishedContent GetById(bool preview, Guid contentKey)
public virtual IPublishedContent GetById(bool preview, Guid contentKey)
{
// original implementation - override in concrete classes
var intId = UmbracoContext.Application.Services.EntityService.GetIdForKey(contentKey, UmbracoObjectTypes.Document);

View File

@@ -21,7 +21,7 @@ namespace Umbraco.Web.PublishedCache
: base(umbracoContext, cache)
{ }
protected override IPublishedContent GetById(bool preview, Guid contentKey)
public override IPublishedContent GetById(bool preview, Guid contentKey)
{
if (InnerCache is PublishedContentCache cc)
return cc.GetById(UmbracoContext, preview, contentKey);

View File

@@ -21,7 +21,7 @@ namespace Umbraco.Web.PublishedCache
: base(umbracoContext, cache)
{ }
protected override IPublishedContent GetById(bool preview, Guid contentKey)
public override IPublishedContent GetById(bool preview, Guid contentKey)
{
if (InnerCache is PublishedMediaCache cc)
return cc.GetById(UmbracoContext, preview, contentKey);

View File

@@ -366,7 +366,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
var xml = GetXml(umbracoContext, false);
var nav = xml.CreateNavigator();
var iter = nav.SelectDescendants(XPathNodeType.Element, true);
_idkMap.Set(Enumerate(iter), UmbracoObjectTypes.Document);
_idkMap.Populate(Enumerate(iter), UmbracoObjectTypes.Document);
}
}