This means we don't have to inject Lazy<T> all over the place when dealing with colleciton builders and circular references since this will automatically just work OOTB. This in theory should also allocate less instances during startup.
18 lines
464 B
C#
18 lines
464 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Umbraco.Cms.Core.Composing;
|
|
|
|
namespace Umbraco.Cms.Core.Cache
|
|
{
|
|
public class CacheRefresherCollection : BuilderCollectionBase<ICacheRefresher>
|
|
{
|
|
public CacheRefresherCollection(Func<IEnumerable<ICacheRefresher>> items) : base(items)
|
|
{
|
|
}
|
|
|
|
public ICacheRefresher this[Guid id]
|
|
=> this.FirstOrDefault(x => x.RefresherUniqueId == id);
|
|
}
|
|
}
|