public ActionResult Register(UserRegister requestUser) { Users newUser = new Users { FirstName = requestUser.FirstName, LastName = requestUser.LastName, Username = requestUser.Username, Email = requestUser.Email, Slug = requestUser.FirstName + DateTime.Now, CreateAt = DateTime.Now, Password = utilityFunction.GetSecurePassword(requestUser.Password), TrashAt = null, UpdateAt = null, }; var saveStates = 0; using (DbEntityContext saveUserDBConn = new DbEntityContext()) { saveUserDBConn.User.Add(newUser); saveStates = saveUserDBConn.SaveChanges(); } return(View()); }