public IActionResult AddSocialAccounts(SocialMediaViewModel model) { if (!ModelState.IsValid) { ViewData["GeneralError"] = Messages.RequiredInput; return(View(model)); } SocialMedia socialMedia = new SocialMedia { Link = model.Link, Type = model.Type }; var data = _socialService.Add(socialMedia); if (data.Success) { ViewData["GeneralSuccess"] = data.Message; return(RedirectToAction("ListSocialAccounts", "ManagementPanel")); } ViewData["GeneralError"] = Messages.GeneralError; return(View(model)); }