예제 #1
0
 public IObservable <IList <Item> > Repos()
 {
     Log.Debug("MainDispatcher # Repos");
     return(triggers.AsObservable()
            .SelectMany(_ => nameSubject.Take(1))
            .Select((name) =>
     {
         Log.Debug("MainDispatcher # Repos # Next");
         IList <Item> items = new List <Item>();
         using (SQLiteConnection connection = db.CreateConnection())
         {
             foreach (Item item in (from x in connection.Table <Item>()
                                    where x.UserName == name
                                    orderby x.Id
                                    select x))
             {
                 items.Add(item);
             }
         }
         return items;
     }));
 }