public IActionResult Registration(UserInformation userInformation) { bool isUserNameExist = _userInformationService.GetUsertNameExist(userInformation.UserName); if (ModelState.IsValid && !isUserNameExist) { _userInformationService.AddUserInformation(userInformation); TempData["Success"] = "Thank you for your registration. As soon as you will receive a confirmation mail" + "in your email address. If you are unable to find it in your inbox then please check your spam folder."; return(View("Login")); } else if (isUserNameExist) { ViewBag.Error = "This user name already exist."; } else { ViewBag.Error = "something is worng"; } return(View()); }