public ActionResult AddOrEdit(User userModel) { using (NewDataBase dbModel = new NewDataBase()) { if (dbModel.Users.Any(x => x.Username == userModel.Username)) { ViewBag.DuplicateMessage = "Username already exist."; return(View("AddOrEdit", userModel)); } dbModel.Users.Add(userModel); dbModel.SaveChanges(); } ModelState.Clear(); ViewBag.SuccessMessage = "Registration Successful."; return(View("AddOrEdit", new User())); }
public string SignUp(string Email, string Password) { NewDataBase Database = new NewDataBase(); return("Fan Guo" + Email); }