Esempio n. 1
0
 /// <summary>
 /// Called after a update database command execute
 /// </summary>
 /// <typeparam name="T">Data type</typeparam>
 /// <param name="updateDataContext">Update data context</param>
 public virtual void OnUpdateCallback <T>(UpdateDataContext <T> updateDataContext) where T : BaseEntity <T>, new()
 {
     if (updateDataContext?.Datas.IsNullOrEmpty() ?? true)
     {
         return;
     }
     RemoveCacheData(updateDataContext.Datas);
 }
Esempio n. 2
0
 /// <summary>
 /// Called before a update database command execute
 /// </summary>
 /// <typeparam name="T">Data type</typeparam>
 /// <param name="updateDataContext">Update data context</param>
 /// <returns>Return policy result</returns>
 public virtual StartingResult OnUpdateStarting <T>(UpdateDataContext <T> updateDataContext) where T : BaseEntity <T>, new()
 {
     if (updateDataContext == null)
     {
         return(StartingResult.Success($"Parameter:{nameof(updateDataContext)} is null"));
     }
     try
     {
         RemoveCacheData(updateDataContext.Datas);
     }
     catch (Exception ex)
     {
         return(DataCacheBehavior.GetStartingResult(DataCacheOperation.RemoveData, ex));
     }
     return(StartingResult.Success());
 }