public ActionResult AddLocationPoint(AddLocationPointDto addLocationPoint) { if (!ModelState.IsValid) { var locationList = _adminServices.GetLocationsDto(); ViewBag.locations = locationList.Select(x => new SelectListItem() { Text = x.LocationName, Value = x.LocationId.ToString() }); return(View(addLocationPoint)); } addLocationPoint.LocationId = Convert.ToInt32(addLocationPoint.LocationIdString); _adminServices.AddLocationPoint(addLocationPoint); return(Redirect("/Admin")); }