/// <summary> /// Called after a remove database command execute /// </summary> /// <typeparam name="T">Data type</typeparam> /// <param name="removeDataContext">Remove data context</param> public virtual void OnRemoveCallback <T>(RemoveDataContext <T> removeDataContext) where T : BaseEntity <T>, new() { if (removeDataContext == null) { return; } RemoveCacheData(removeDataContext.Datas); }
/// <summary> /// Called before a remove database command execute /// </summary> /// <typeparam name="T">Data type</typeparam> /// <param name="removeDataContext">Remove data context</param> /// <returns>Return policy result</returns> public virtual StartingResult OnRemoveStarting <T>(RemoveDataContext <T> removeDataContext) where T : BaseEntity <T>, new() { if (removeDataContext == null) { return(StartingResult.Success($"Parameter:{nameof(removeDataContext)} is null")); } try { RemoveCacheData(removeDataContext.Datas); } catch (Exception ex) { return(DataCacheBehavior.GetStartingResult(DataCacheOperation.RemoveData, ex)); } return(StartingResult.Success()); }