public async Task <IActionResult> Edit(int id)
        {
            try
            {
                var addressTypeViewModel = await _iAddressTypeManager.GetAddressTypeAsync(id);

                var model = _iMapper.Map <AddressTypeViewModel, AddressTypePageViewModel>(addressTypeViewModel);

                if (model != null)
                {
                    return(PartialView("_CreateOrEdit", model));
                }
                else
                {
                    return(ErrorPartialView(ExceptionHelper.ExceptionErrorMessageForNullObject()));
                }
            }
            catch (Exception ex)
            {
                return(ErrorPartialView(ex));
            }
        }
        public async Task <IActionResult> Edit(int id)
        {
            try
            {
                var model = await _iAddressTypeManager.GetAddressTypeAsync(id);

                if (model != null)
                {
                    return(View("AddOrEdit", model));
                }
                else
                {
                    this.FlashError(ExceptionHelper.ExceptionErrorMessageForNullObject(), "AddressTypeMessage");
                    return(RedirectToAction("Index", "AddressType"));
                }
            }
            catch (Exception ex)
            {
                _log.Error(LogMessageHelper.FormateMessageForException(ex, "Edit[GET]"));
            }

            this.FlashError(MessageHelper.UnhandelledError, "AddressTypeMessage");
            return(RedirectToAction("Index", "AddressType"));
        }