Beispiel #1
0
 public override IEnumerable <IPersistEntity> QueryItems()
 {
     try
     {
         if (Count() > 0)
         {
             if (CoverMode == CoverMode.Persistent)
             {
                 var items = m_db.QueryItems("*", null);
                 return(items == null ? null : items.Cast <IPersistEntity>());
             }
             else
             {
                 List <IPersistEntity> list = new List <IPersistEntity>();
                 foreach (var g in QueueList)
                 {
                     list.Add(new PersistItem()
                     {
                         body = g.Value, key = g.Key.Identifier, name = Name, timestamp = g.Key.ArrivedTime
                     });
                 }
                 return(list);
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Exception("QueryItems ", ex);
     }
     //if no items
     return(new List <IPersistEntity>());
 }
Beispiel #2
0
 public override IEnumerable <IPersistEntity> QueryItems()
 {
     try
     {
         if (Count() > 0)
         {
             var items = m_db.QueryItems("*", null);
             return(items == null ? null : items.Cast <IPersistEntity>());
         }
     }
     catch (Exception ex)
     {
         Logger.Exception("QueryItems", ex);
     }
     //if no items
     return(new List <IPersistEntity>());
 }