public ActionResult GetCustomerAddress() { string id = _sessionContext.CurrentUser != null?_sessionContext.CurrentUser.UserId.ToString() : null; if (string.IsNullOrEmpty(id)) { return(JsonSuccess(new List <AddressModel>(), JsonRequestBehavior.AllowGet)); } var result = _customerRepository.GetCustomerAddress <AddressModel>(id); if (result.Result != null) { foreach (var item in result.Result) { item.CustomerId = id; } } return(JsonSuccess(result.Result, JsonRequestBehavior.AllowGet)); }