Exemple #1
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            // Check if logged in user is still in the system, if not then sign user out and return to homepage
            if (!await _applicationUser.UserExistsById(User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                await _signInManager.SignOutAsync();

                return(RedirectToAction("Index", "Home", new { area = "" }));
            }

            await _leiunurk.RemoveItem(id);

            StatusMessage = "The Item has been deleted!";
            return(RedirectToAction(nameof(Index)));
        }