public Guid?AddCity(string cityName, string countryShort) { if (string.IsNullOrEmpty(cityName)) { throw new ArgumentException("City name doesn't exist"); } using (var scope = _dbContextScope.Create()) { return(_addressRepository.AddCity(cityName, countryShort)); } }
public ActionResult CreateCity(ViewAddress viewaddress, long stateId, long countryId, String returnTo) { try { if (ModelState.IsValid) { _addressRepository.AddCity(viewaddress, GetUserId()); return(RedirectToAction("SelectCity", new { id = stateId, countryID = countryId, returnTo })); } return(View(viewaddress)); } catch (Exception e) { ExceptionMessageToViewBag(e); return(View("Error")); } }