Ejemplo n.º 1
0
        public async Task <IActionResult> OnPostDeleteDocumentAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var documentID = id.GetValueOrDefault();
            var success    = await _context.DeleteDocumentAsync(documentID);

            if (success)
            {
                return(RedirectToPage("./Details", new { id = Session.SessionID }));
            }

            return(RedirectToPage("/Error"));
        }