public async Task <object> GetById(int id) { try { User user = await userService.GetById(id); return(new { Status = Models.APIResult.ResultSuccessStatus, User = user }); } catch (Exception e) { throw new InternalServerErrorException(e.Message); } }
public async Task <IActionResult> Update(int id) { var result = await _userApiService.GetById(id); if (result.Success) { return(View("AddOrUpdate", result.Data)); } else { ErrorAlert("Kullanıcı bulunamadı." + result.Message); return(RedirectToAction("Index")); } }