Beispiel #1
0
        public IActionResult CreateWebsite(Website item)
        {
            if (!ModelState.IsValid)
            {
                return(View("Create", item));
            }

            item.UserID = user_manager.FindByNameAsync(User.Identity.Name).Result.UserHash;

            if (item.Username == null)
            {
                item.Username = "";
            }
            if (item.URL == null)
            {
                item.URL = "";
            }
            if (item.PasswordValue == null)
            {
                item.PasswordValue = "";
            }

            website_repo.Insert(item);

            return(RedirectToAction("Index"));
        }