using System; using System.Collections.Generic; using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Cache { /// /// Creates cache policies /// /// /// internal class FullDataSetRepositoryCachePolicyFactory : IRepositoryCachePolicyFactory where TEntity : class, IAggregateRoot { private readonly IRuntimeCacheProvider _runtimeCache; private readonly Func _getEntityId; private readonly Func> _getAllFromRepo; private readonly bool _expires; public FullDataSetRepositoryCachePolicyFactory(IRuntimeCacheProvider runtimeCache, Func getEntityId, Func> getAllFromRepo, bool expires) { _runtimeCache = runtimeCache; _getEntityId = getEntityId; _getAllFromRepo = getAllFromRepo; _expires = expires; } public virtual IRepositoryCachePolicy CreatePolicy() { return new FullDataSetRepositoryCachePolicy(_runtimeCache, _getEntityId, _getAllFromRepo, _expires); } } }