public bool SaveScheduledTask(SmartEarthTask task) { var collection = Database.GetCollection <SmartEarthTask>(Core.SCHEDULED_TASK_DATABASE_DOCUMENT); if (collection == null) { return(false); } var result = collection.Upsert(task); UpdateScheduledTasks(); return(result); }
public bool RemoveScheduledTask(SmartEarthTask task) { var collection = Database.GetCollection <SmartEarthTask>(Core.SCHEDULED_TASK_DATABASE_DOCUMENT); if (collection == null) { return(false); } var count = collection.Delete(t => t.Signature == task.Signature) > 0; UpdateScheduledTasks(); return(count); }