using WingServerCommon.Interfaces.OpLog;
namespace WingServerCommon.Interfaces.Cache
{
public interface ICacheManager
{
//
/// Remove many cache record with specified document ids
///
/// The db collection document uopdate or deletes args
void RemoveMany(CollectionDocumentChangedArgs args);
}
public interface IBaseCacheManager : ICacheManager where T : ICacheObject
{
///
/// Register functions
///
///
///
void RegisterDBFunction(Func loadCacheFromDbWithId, Func, IList> loadCachesFromDbWithIds);
///
/// Load cache from db objects
///
/// the cache object list
void LoadFromDbOject(IList cacheObjs);
///
/// Remove a cache record with specified document id
///
/// The db collection document id
void Remove(string documentId);
///
/// Add a cache object to cache manager
///
/// A new cache object
void Add(T cacheObj);
///
/// Get cache with specified document id
///
/// the document id, the code in db
///
///
T Get(string documentId);
///
/// Find values whith filters
///
///
///
IList Where(Func predicate);
}
public interface ICacheObject
{
///
/// The unique id for on record , the code in db actually
///
///
string Code { get; set; }
}
}