2016-01-07 16:31:20 +01:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Umbraco.Core.Models.EntityBase;
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Cache
|
|
|
|
|
{
|
|
|
|
|
internal interface IRepositoryCachePolicy<TEntity, TId> : IDisposable
|
|
|
|
|
where TEntity : class, IAggregateRoot
|
|
|
|
|
{
|
|
|
|
|
TEntity Get(TId id, Func<TId, TEntity> getFromRepo);
|
|
|
|
|
TEntity Get(TId id);
|
|
|
|
|
bool Exists(TId id, Func<TId, bool> getFromRepo);
|
2016-02-02 00:47:18 +01:00
|
|
|
|
2016-01-07 16:31:20 +01:00
|
|
|
void CreateOrUpdate(TEntity entity, Action<TEntity> persistMethod);
|
|
|
|
|
void Remove(TEntity entity, Action<TEntity> persistMethod);
|
|
|
|
|
TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> getFromRepo);
|
|
|
|
|
}
|
|
|
|
|
}
|