Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 public static string GetUrl(HashtagDetailsViewModel item, RecipeLineViewModel recipe)
 {
     return(GetUrl(item.Name, recipe.Name));
 }
Exemplo n.º 3
0
 public static string GetUrl(HashtagDetailsViewModel item, string action = null)
 {
     return(GetUrl(item.Name, action));
 }