public void DeleteAllMeetingTimesData() { using (var ctx = new LocalDatabaseContext(_localDbFilePath)) { ctx.Db.DropCollection(CollectionNameMtgTimes); } }
public void Save(MeetingTimes mtgTimes) { using (var ctx = new LocalDatabaseContext(_localDbFilePath)) { var timings = ctx.Db.GetCollection <MeetingTimes>(CollectionNameMtgTimes); timings.Insert(mtgTimes); } }
public MeetingTimes GetMeetingTimes(Guid session) { using var ctx = new LocalDatabaseContext(_localDbFilePath); var timings = ctx.Db.GetCollection <MeetingTimes>(CollectionNameMtgTimes); timings.EnsureIndex(x => x.Session); return(timings.FindOne(x => x.Session.Equals(session))); }
public void Save(MeetingTimes?mtgTimes) { if (mtgTimes == null) { return; } using var ctx = new LocalDatabaseContext(_localDbFilePath); var timings = ctx.Db.GetCollection <MeetingTimes>(CollectionNameMtgTimes); timings.Insert(mtgTimes); }
public IReadOnlyCollection <MeetingTimes> GetMeetingTimes(DateTime theDate) { using (var ctx = new LocalDatabaseContext(_localDbFilePath)) { var timings = ctx.Db.GetCollection <MeetingTimes>(CollectionNameMtgTimes); timings.EnsureIndex(x => x.MeetingDate); var minDate = theDate.Date; var maxDate = theDate.Date.AddDays(1); return(timings.Find( x => x.MeetingDate >= minDate && x.MeetingDate < maxDate) .OrderBy(x => x.MeetingTimesId).ToArray()); } }