public static WellLogInterval Latest() { List <WellLogInterval> w = WellLogIntervalcollection.Find(s => (s._id != null && s.Complete == false)).SortByDescending(s => s._id).Limit(1).ToListAsync().Result; if (w.Count > 0) { return(w[0]); } else { return(null); } }
public static WellLogInterval fromTime(System.DateTime t) { List <WellLogInterval> d = WellLogIntervalcollection.Find(s => (s._id != null && s.StartLog <= t && s.StopLog >= t)).SortByDescending(s => s._id).Limit(1).ToListAsync().Result; if (d.Count > 0) { return(d[0]); } else { return(null); } }
} //'Allows for time machine public void Save() { WellLogIntervalcollection.InsertOne(this); }