コード例 #1
0
        public async Task <IActionResult> Delete(Book book)
        {
            bool isAdmin = await _cs.IsItAdminAsync(User.Identity.Name);

            if (!isAdmin)
            {
                return(Unauthorized());
            }

            await _bc.DeleteAsync(book);

            await _bc.CommitAsync();

            return(RedirectToAction(nameof(Index)));
        }