Esempio n. 1
0
 public ActionResult Create(myContact _mycontact)
 {
     if (ModelState.IsValid)
     {
         _db.myContacts.Add(_mycontact);
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(_mycontact));
 }
        public ActionResult Register(string Username, string Email, string Password)
        {
            if (Username == null || Email == null || Password == null)
            {
                return(null);
            }
            using (mvcappdb context = new mvcappdb())
            {
                context.Table.Add(new Player()
                {
                    Username = Username, Email = Email, Password = Password
                });
                context.SaveChanges();
            }

            ViewBag.name = Username;
            return(View());
        }