public async Task <IActionResult> Edit(int id) { try { var model = await _iAddressManager.GetAddressEntityAsync(id); if (model != null) { ViewBag.CountryList = await _iAddressManager.GetCountryEntitysAsync(); ViewBag.StateList = await _iAddressManager.GetStateEntitysAsync(); return(View("AddOrEdit", model)); } else { this.FlashError(ExceptionHelper.ExceptionErrorMessageForNullObject(), "AddressMessage"); return(RedirectToAction("Index", "Address")); } } catch (Exception ex) { _log.Error(LogMessageHelper.FormateMessageForException(ex, "Edit[GET]")); } this.FlashError(MessageHelper.UnhandelledError, "AddressMessage"); return(RedirectToAction("Index", "Address")); }
public async Task <IActionResult> GetAddress(int id) { try { _log.Info(LogMessageHelper.FormateMessageForStart("GetAddress[GET]")); var response = await _iAddressManager.GetAddressEntityAsync(id); return(Ok(response)); } catch (Exception ex) { _log.Error(LogMessageHelper.FormateMessageForException(ex, "GetAddress[GET]")); } return(BadRequest(MessageHelper.NullReferenceExceptionError)); }