porting 7.6-rc1 into 8

This commit is contained in:
Stephan
2017-05-12 14:49:44 +02:00
parent ade6c2f057
commit 8561d85f7a
1148 changed files with 41983 additions and 17045 deletions

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Scoping;
namespace Umbraco.Core.Cache
{
@@ -19,14 +20,18 @@ namespace Umbraco.Core.Cache
internal class DefaultRepositoryCachePolicy<TEntity, TId> : RepositoryCachePolicyBase<TEntity, TId>
where TEntity : class, IAggregateRoot
{
private static readonly TEntity[] EmptyEntities = new TEntity[0];
private static readonly TEntity[] EmptyEntities = new TEntity[0]; // const
private readonly RepositoryCachePolicyOptions _options;
public DefaultRepositoryCachePolicy(IRuntimeCacheProvider cache, RepositoryCachePolicyOptions options)
: base(cache)
{
if (options == null) throw new ArgumentNullException(nameof(options));
_options = options;
_options = options ?? throw new ArgumentNullException(nameof(options));
}
public override IRepositoryCachePolicy<TEntity, TId> Scoped(IRuntimeCacheProvider runtimeCache, IScope scope)
{
return new ScopedRepositoryCachePolicy<TEntity, TId>(this, runtimeCache, scope);
}
protected string GetEntityCacheKey(object id)