コード例 #1
0
        public async Task <IActionResult> EditQr(int id)
        {
            var userId = _userService.GetUserId();
            var qrTag  = await _qrCodeRepository.GetQrById(id);

            if (qrTag != null)
            {
                if (qrTag.User.Id == userId)
                {
                    return(View(qrTag));
                }
                throw new Exception("Permission Denied.");
            }
            throw new Exception("Couldn't fetch your tag.");
        }