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

            ListaDeTareas = await _context.ListaDeTareas.FirstOrDefaultAsync(m => m.ListaDeTareasID == id);

            if (ListaDeTareas == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ListaDeTareas = await _context.ListaDeTareas.FindAsync(id);

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

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