Exemple #1
0
 private SortableList <IFavorite> TryLodFromDatabase(string historyDateKey)
 {
     using (Database database = DatabaseConnections.CreateInstance())
     {
         HistoryInterval interval = HistoryIntervals.GetIntervalByName(historyDateKey);
         // store holds dates in UTC
         var favoriteIds = database.GetFavoritesHistoryByDate(interval.From, interval.To).ToList();
         IEnumerable <DbFavorite> intervalFavorites =
             this.favorites.Cast <DbFavorite>().Where(favorite => favoriteIds.Contains(favorite.Id));
         return(Data.Favorites.OrderByDefaultSorting(intervalFavorites));
     }
 }