コード例 #1
0
 public IObservable <Station> GetStationAsync(string stationCode)
 {
     return(Observable.FromAsync(cts =>
     {
         return _dustContext.Stations.FirstOrDefaultAsync(s => s.Code == stationCode, cts);
     }).Select(async station =>
     {
         if (station != null)
         {
             await _dustContext.Entry(station).Collection(c => c.Records).LoadAsync();
         }
         return station;
     }).Switch());
     //if (station != null)
     //    _dustContext.Entry(station).Collection(s => s.Records).Load();
 }