Пример #1
0
 /// <summary>
 /// Called after a remove database command execute
 /// </summary>
 /// <typeparam name="T">Data type</typeparam>
 /// <param name="removeByQueryContext">Remove by query context</param>
 public virtual void OnRemoveByQueryCallback <T>(RemoveByQueryContext <T> removeByQueryContext) where T : BaseEntity <T>, new()
 {
     if (removeByQueryContext?.Datas.IsNullOrEmpty() ?? true)
     {
         return;
     }
     RemoveCacheData(removeByQueryContext.Datas);
 }
Пример #2
0
 /// <summary>
 /// Called before a remove database command execute
 /// </summary>
 /// <typeparam name="T">Data type</typeparam>
 /// <param name="removeByQueryContext">Remove by query context</param>
 /// <returns>Return policy result</returns>
 public virtual StartingResult OnRemoveByQueryStarting <T>(RemoveByQueryContext <T> removeByQueryContext) where T : BaseEntity <T>, new()
 {
     if (removeByQueryContext == null)
     {
         return(StartingResult.Success($"Parameter:{nameof(removeByQueryContext)} is null"));
     }
     try
     {
         RemoveCacheData(removeByQueryContext.Datas);
     }
     catch (Exception ex)
     {
         return(DataCacheBehavior.GetStartingResult(DataCacheOperation.RemoveData, ex));
     }
     return(StartingResult.Success());
 }