public async Task <IActionResult> CreatePOST(CustomerAddress customerAdress, string returnUrl = null) { // returnUrl = returnUrl ?? Url.Content("~/Customer/Address"); customerAdress.PersonID = User.FindFirst(ClaimTypes.NameIdentifier).Value; if (!ModelState.IsValid) { return(View(customerAdress)); } CustomerAddress.Add(customerAdress); _db.Add(customerAdress); await _db.SaveChangesAsync(); if (returnUrl == null) { return(RedirectToAction("Index", new { Message = "The Address has been added" })); } return(LocalRedirect(returnUrl)); // return RedirectToAction(nameof(Index)); }