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

            IStory = await _context.Storyes.FirstOrDefaultAsync(m => m.Id == id);

            if (IStory == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Esempio n. 2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            IStory = await _context.Storyes.FindAsync(id);

            if (IStory != null)
            {
                _context.Storyes.Remove(IStory);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Create"));
        }