using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Cache { class NoCacheRepositoryCachePolicy : IRepositoryCachePolicy where TEntity : class, IAggregateRoot { public void ClearAll() { // nothing to clear - not caching } public void Create(TEntity entity, Action persistNew) { persistNew(entity); } public void Delete(TEntity entity, Action persistDeleted) { persistDeleted(entity); } public bool Exists(TId id, Func performExists, Func> performGetAll) { return performExists(id); } public TEntity Get(TId id, Func performGet, Func> performGetAll) { return performGet(id); } public TEntity[] GetAll(TId[] ids, Func> performGetAll) { return performGetAll(ids).ToArray(); } public TEntity GetCached(TId id) { return null; } public void Update(TEntity entity, Action persistUpdated) { persistUpdated(entity); } } }