コード例 #1
0
        public async Task <IActionResult> OnGetWithId(int id)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToPage("/Login"));
            }

            SingleCollection = await _collectionController.GetByIdAsync(id);

            IsById = true;

            var idString = User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.NameIdentifier).Value;
            var uid      = int.Parse(idString);

            var usr = await _userController.GetByIdAsync(uid);

            IsInUserCollection = await _collectionController.IsInUserCollection(id, usr.Id);

            return(Page());
        }