public async Task <IActionResult> Details(string name, bool?viewIcons = null) { var repository = new SiteRepository(_settings.AzureStorageConnectionString); var site = await repository.GetAsync(); var recipes = site.GetRecipesByHashtag(name); var viewModel = new HashtagDetailsViewModel(name, recipes); if (viewIcons == null) { if (this.Request.Cookies.ContainsKey("RecipeViewIcons")) { // Load default from cookie. viewIcons = this.Request.Cookies["RecipeViewIcons"] == "true"; } else { viewIcons = false; } } else { // Save to cookie this.Response.Cookies.Append("RecipeViewIcons", "true"); } ViewBag.ViewIcons = viewIcons; return(View(viewModel)); }
public static string GetUrl(HashtagDetailsViewModel item, RecipeLineViewModel recipe) { return(GetUrl(item.Name, recipe.Name)); }
public static string GetUrl(HashtagDetailsViewModel item, string action = null) { return(GetUrl(item.Name, action)); }