public IActionResult EditSocialData(AppSocialLinkUpdateViewModel model)
        {
            if (ModelState.IsValid)
            {
                var item = _appRepository.GetInfo(model.Id);
                item.UrlAddress = model.UrlAddress;

                if (model.AppSocialImgs != null)
                {
                    if (model.ExistingSocialImagePath != null)
                    {
                        string filePath = Path.Combine(_hostingEnvironment.WebRootPath,
                                                       "images", model.ExistingSocialImagePath);
                        System.IO.File.Delete(filePath);
                    }
                    item.AppSocialImg = ProcessUploadAppSocialImage(model);
                }

                _appRepository.Update(item);

                TempData["message"] = $"Object {item.UrlAddress} was edited.";

                return(RedirectToAction("SocialList"));
            }
            return(View());
        }
        public IActionResult EditSocialData(int id)
        {
            var data = _appRepository.GetInfo(id);

            var item = new AppSocialLinkUpdateViewModel
            {
                Id         = data.Id,
                UrlAddress = data.UrlAddress,
                ExistingSocialImagePath = data.AppSocialImg
            };

            TempData["message"] = $"Object {item.UrlAddress} was selected.";
            return(View(item));
        }