示例#1
0
 public static PlaylistInfo TracksAndIndex()
 {
     return(MusicDataContext.WithConnection <PlaylistInfo>(db => {
         var tracks = Tracks(db);
         return new PlaylistInfo(tracks, Index(db));
     }));
 }
 public static ObservableCollection <PlayFrequency> MostPlayed(int count = 100)
 {
     return(MusicDataContext.WithConnection(db => {
         var mostPlayed = (from PlayFrequency playFreq in db.PlayFrequencies
                           orderby playFreq.PlayCount descending
                           select playFreq).Take(count);
         return new ObservableCollection <PlayFrequency>(mostPlayed);
     }));
 }
 public override Task <List <string> > LeastPlayed(int count = 20)
 {
     return(TaskEx.Run(() => {
         return MusicDataContext.WithConnection(db => {
             var leastPlayed = (from PlayFrequency playFreq in db.PlayFrequencies
                                orderby playFreq.PlayCount ascending
                                select playFreq.SongPath).Take(count);
             return new List <string>(leastPlayed);
         });
     }));
 }
示例#4
0
 public static int Index()
 {
     return(MusicDataContext.WithConnection <int>(db => {
         return Index(db);
     }));
 }
示例#5
0
 public static List <PlaylistTrack> Tracks()
 {
     return(MusicDataContext.WithConnection <List <PlaylistTrack> >(db => {
         return Tracks(db);
     }));
 }