2017-07-20 11:21:28 +02:00
|
|
|
|
using Umbraco.Core.Models.EntityBase;
|
2017-12-15 16:29:14 +01:00
|
|
|
|
using Umbraco.Core.Scoping;
|
2016-01-07 16:31:20 +01:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Cache
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2016-06-01 10:35:44 +02:00
|
|
|
|
/// Represents a special policy that does not cache the result of GetAll.
|
2016-01-07 16:31:20 +01:00
|
|
|
|
/// </summary>
|
2016-06-01 10:35:44 +02:00
|
|
|
|
/// <typeparam name="TEntity">The type of the entity.</typeparam>
|
|
|
|
|
|
/// <typeparam name="TId">The type of the identifier.</typeparam>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// <para>Overrides the default repository cache policy and does not writes the result of GetAll
|
|
|
|
|
|
/// to cache, but only the result of individual Gets. It does read the cache for GetAll, though.</para>
|
|
|
|
|
|
/// <para>Used by DictionaryRepository.</para>
|
|
|
|
|
|
/// </remarks>
|
2016-01-07 17:54:55 +01:00
|
|
|
|
internal class SingleItemsOnlyRepositoryCachePolicy<TEntity, TId> : DefaultRepositoryCachePolicy<TEntity, TId>
|
2016-01-07 16:31:20 +01:00
|
|
|
|
where TEntity : class, IAggregateRoot
|
|
|
|
|
|
{
|
2017-12-15 16:29:14 +01:00
|
|
|
|
public SingleItemsOnlyRepositoryCachePolicy(IRuntimeCacheProvider cache, IScopeAccessor scopeAccessor, RepositoryCachePolicyOptions options)
|
|
|
|
|
|
: base(cache, scopeAccessor, options)
|
2016-06-01 10:35:44 +02:00
|
|
|
|
{ }
|
|
|
|
|
|
|
2016-06-01 14:31:33 +02:00
|
|
|
|
protected override void InsertEntities(TId[] ids, TEntity[] entities)
|
2016-01-07 16:31:20 +01:00
|
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
|
// nop
|
2016-01-07 16:31:20 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|