Beispiel #1
0
        public IActionResult AccountDetail(int id)
        {
            var userId = User.GetUserId();

            // ایا اکانت موجود می باشد
            var exist = _accountGameRepository.ExistById(id);

            if (!exist)
            {
                return(RedirectToAction(nameof(AccountList)));
            }

            // آیا اکانت توسط کاربر ایجاد شده است
            var isCreateByUser = _accountGameRepository.IsCreateByUser(userId, id);

            if (!isCreateByUser)
            {
                return(RedirectToAction(nameof(AccountList)));
            }

            var model = _accountGameRepository.GetById(id);

            return(View(model));
        }