예제 #1
0
        public IActionResult Index()
        {
            List <Models.Anuncio> cars = new List <Models.Anuncio>();

            BD.Repo.Anuncio repo = new BD.Repo.Anuncio();
            cars = repo.Consultar();

            return(View(cars));
        }
예제 #2
0
        public bool Del(int id)
        {
            try
            {
                Models.Anuncio  car  = new Models.Anuncio();
                BD.Repo.Anuncio repo = new BD.Repo.Anuncio();
                car = repo.Consultar(id);

                repo.Remover(car);
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }