Changes Set to Populate, changes Fetch to Query and makes GetById public
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user