Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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"));
            }
        }