public static bool Delete(RankingGenre genre) { var db = HohoemaLiteDb.GetLocalLiteRepository(); var genreCode = genre.ToString(); return(db.Delete <RankingGenreTagsInfo>(x => x.GenreCode == genreCode) > 0); }
public bool Upsert(RankingGenre genre, IEnumerable <RankingGenreTagEntry> tags) { return(_collection.Upsert(new RankingTagsGenreGroupedEntry() { GenreCode = genre.ToString(), Tags = tags.ToList(), UpdateAt = DateTime.Now })); }
public RankingTagsGenreGroupedEntry Get(RankingGenre genre) { if (genre == RankingGenre.All) { return(null); } var genreCode = genre.ToString(); return(_collection.FindOne(x => x.GenreCode == genreCode)); }
public static bool Upsert(RankingGenre genre, IEnumerable <RankingGenreTag> tags) { var db = HohoemaLiteDb.GetLocalLiteRepository(); db.Upsert(new RankingGenreTagsInfo() { GenreCode = genre.ToString(), Tags = tags.ToList(), UpdateAt = DateTime.Now }); return(true); }
public static RankingGenreTagsInfo Get(RankingGenre genre) { if (genre == RankingGenre.All) { return(null); } var db = HohoemaLiteDb.GetLocalLiteRepository(); var genreCode = genre.ToString(); return(db.SingleOrDefault <RankingGenreTagsInfo>(x => x.GenreCode == genreCode)); }
HohoemaPin IPinablePage.GetPin() { var genreName = RankingGenre.Translate(); var tag = SelectedRankingTag.Value?.Tag; var pickedTag = PickedTags.FirstOrDefault(x => x.Tag == tag); Dictionary <string, string> pairs = new Dictionary <string, string>(); pairs.Add(RankingCategoryPageNavigationConstants.RankingGenreQueryKey, RankingGenre.ToString()); if (!string.IsNullOrEmpty(pickedTag.Tag) && pickedTag.Tag != "all") { pairs.Add(RankingCategoryPageNavigationConstants.RankingGenreTagQueryKey, pickedTag.Tag); } return(new HohoemaPin() { Label = pickedTag != null ? $"{pickedTag.Label} - {genreName}" : $"{genreName}", PageType = HohoemaPageType.RankingCategory, Parameter = pairs.ToQueryString() }); }
public bool Delete(RankingGenre genre) { var genreCode = genre.ToString(); return(_collection.DeleteMany(x => x.GenreCode == genreCode) > 0); }
public static INavigationParameters SetRankingGenre(this INavigationParameters parameters, RankingGenre rankingGenre) { parameters.Add(RankingGenreQueryKey, Uri.EscapeDataString(rankingGenre.ToString())); return(parameters); }