Files
Umbraco-CMS/src/Umbraco.Infrastructure/Cache/SingleItemsOnlyRepositoryCachePolicy.cs

33 lines
1.2 KiB
C#
Raw Normal View History

2022-01-13 17:44:11 +00:00
// Copyright (c) Umbraco.
// See LICENSE for more details.
using Umbraco.Cms.Core.Models.Entities;
using Umbraco.Cms.Core.Scoping;
2022-01-13 17:44:11 +00:00
using Umbraco.Cms.Infrastructure.Scoping;
namespace Umbraco.Cms.Core.Cache
{
/// <summary>
/// Represents a special policy that does not cache the result of GetAll.
/// </summary>
/// <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>
where TEntity : class, IEntity
{
2019-01-18 07:56:38 +01:00
public SingleItemsOnlyRepositoryCachePolicy(IAppPolicyCache cache, IScopeAccessor scopeAccessor, RepositoryCachePolicyOptions options)
: base(cache, scopeAccessor, options)
{ }
2022-02-24 10:22:20 +01:00
protected override void InsertEntities(TId[]? ids, TEntity[]? entities)
{
// nop
}
}
2017-07-20 11:21:28 +02:00
}