/// <summary> /// Load all of the previously uploaded ColorHex /// </summary> /// <returns></returns> public static List <ColorHex> LoadAll() { MongoCollection <ColorHex> Collection = Execute.GetCollection <ColorHex>(COLLECTION_NAME); return((List <ColorHex>)(from e in Collection.AsQueryable <ColorHex>() orderby e.ModifiedDateUTC descending select e).ToList()); }
/// <summary> /// Load a list of images that were uploaded after the passed in date object /// </summary> /// <param name="lastKnownUploadDate"></param> /// <returns></returns> public static List <Image> LoadRecentlyUploaded(DateTime lastKnownUploadDate) { MongoCollection <Image> Collection = Execute.GetCollection <Image>(COLLECTION_NAME); return((List <Image>)(from e in Collection.AsQueryable <Image>() where e.ModifiedDateUTC >= lastKnownUploadDate orderby e.ModifiedDateUTC descending select e).ToList()); }
/// <summary> /// save ColorHex to database. /// </summary> /// <param name="image"></param> /// <returns>bool if successfully saved to DB</returns> public static bool Save(ColorHex colorHex) { return(Execute.Save <ColorHex>(COLLECTION_NAME, colorHex)); }
/// <summary> /// save image to database. /// </summary> /// <param name="image"></param> /// <returns>bool if successfully saved to DB</returns> public static bool Save(Image image) { return(Execute.Save <Image>(COLLECTION_NAME, image)); }