public void Run()
        {
            List <WarframeItem> allMods = warframeItemUtilities.GetAllMods();

            ModSuggestionRepository repo           = uow.GetRepo <ModSuggestionRepository>();
            List <ModSuggestion>    modSuggestions = repo.GetAll();

            foreach (ModSuggestion modSuggestion in modSuggestions)
            {
                WarframeItem item = allMods.SingleOrDefault(x => x.UniqueName == modSuggestion.UniqueName);
                if (item != null)
                {
                    string json = JsonConvert.SerializeObject(item);
                    if (modSuggestion.WarframeItemJson != json)
                    {
                        modSuggestion.WarframeItemJson = json;
                        repo.Update(modSuggestion);
                    }
                }
            }
        }
        public IActionResult RefreshModSuggestions()
        {
            List <WarframeItem> allMods = itemUtils.GetAllMods();

            ModSuggestionRepository repo           = uow.GetRepo <ModSuggestionRepository>();
            List <ModSuggestion>    modSuggestions = repo.GetAll();

            foreach (ModSuggestion modSuggestion in modSuggestions)
            {
                WarframeItem item = allMods.SingleOrDefault(x => x.UniqueName == modSuggestion.UniqueName);
                if (item != null)
                {
                    string json = JsonConvert.SerializeObject(item);
                    if (modSuggestion.WarframeItemJson != json)
                    {
                        modSuggestion.WarframeItemJson = json;
                        repo.Update(modSuggestion);
                    }
                }
            }
            return(Message("Done"));
        }
 public IActionResult Edit([Bind(Prefix = "ModSuggestion")] ModSuggestion model)
 {
     if (ModelState.IsValid)
     {
         ModSuggestionRepository repo         = uow.GetRepo <ModSuggestionRepository>();
         WarframeItem            warframeItem = warframeItemUtilities.GetAllMods().SingleOrDefault(x => x.UniqueName == model.UniqueName);
         warframeItem.Name      = warframeItem.Name.Replace("'S", "'s");
         model.WarframeItemJson = JsonConvert.SerializeObject(warframeItem);
         if (model.ID == 0)
         {
             repo.Add(model);
             TempData["message"] = "Mod Suggestion Added";
         }
         else
         {
             repo.Update(model);
             TempData["message"] = "Mod Suggestion Updated";
         }
         return(RedirectToAction("Index"));
     }
     return(View(new EditModSuggestionViewModel().Load(model, uow, warframeItemUtilities)));
 }