public void SetRecentStopAtRoute(Route route, StopGroup stop) { lock (ctx) { var recentEntry = ctx.RecentEntries.Where(e => e.RouteID == route.ID).SingleOrDefault(); if (recentEntry != null) { ctx.Delete(recentEntry); } var entry = new RecentEntry { Route = route, Stop = stop }; ctx.Insert(entry); } }
public void Remove(Route route, StopGroup stop) { lock (ctx) { var entry = ctx.FavoriteEntries.Where(e => e.RouteID == route.ID && e.StopID == stop.ID).Single(); ctx.Delete(entry); } }