/// <summary>
 ///
 /// </summary>
 /// <param name="enumerable"></param>
 /// <param name="period"></param>
 public static bool AddRange(IEnumerable <ShareEntity> enumerable, int period = 0)
 {
     if (DataSyncQueueManager.SendSync(enumerable))
     {
         foreach (var t in enumerable)
         {
             CacheItemSet itemSet;
             if (CacheFactory.AddOrUpdateEntity(t, out itemSet, period))
             {
                 itemSet.OnLoadSuccess();
             }
         }
         return(true);
     }
     return(false);
 }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="checkMutilKey">The entity need to reload when it has be mutil key</param>
 /// <param name="enumerable"></param>
 public static bool AddRange(bool checkMutilKey, params BaseEntity[] enumerable)
 {
     if (DataSyncQueueManager.SendSync(enumerable))
     {
         foreach (var t in enumerable)
         {
             var          schema = t.GetSchema();
             CacheItemSet itemSet;
             if (CacheFactory.AddOrUpdateEntity(t, out itemSet))
             {
                 if (checkMutilKey && schema.Keys.Length > 1 && !itemSet.HasLoadSuccess)
                 {
                     ReLoad(t.PersonalId, schema);
                 }
                 else
                 {
                     itemSet.OnLoadSuccess();
                 }
             }
         }
         return(true);
     }
     return(false);
 }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="V"></typeparam>
 /// <param name="dataList"></param>
 /// <returns></returns>
 public bool SendSync <V>(IEnumerable <V> dataList) where V : AbstractEntity, new()
 {
     return(DataSyncQueueManager.SendSync(dataList));
 }