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

            LISTA = await _context.LISTA.FirstOrDefaultAsync(m => m.ID == id);

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

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

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

            return(RedirectToPage("./Index"));
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            LISTA <int> lista = new LISTA <int>();


            for (int i = 0; i < 5; i++)
            {
                NODO <int> nodo = new NODO <int>();

                nodo.Valor = i;

                lista.AgregarUltimo(nodo);
            }
            Console.ReadLine();
            for (int i = 0; i < 5; i++)
            {
                Console.WriteLine("Se removió el nodo en la posición " + i.ToString() + " quedan " + lista.Remover(i).ToString() + " nodos en la lista.");
                Console.ReadLine();
            }
        }