Пример #1
0
        public IActionResult Index()
        {
            List <Models.AnuncioWebmotors> cars = new List <Models.AnuncioWebmotors>();

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

            return(View(cars));
        }
Пример #2
0
        public bool Del(int id)
        {
            try
            {
                Models.AnuncioWebmotors  car  = new Models.AnuncioWebmotors();
                BD.Repo.AnuncioWebmotors repo = new BD.Repo.AnuncioWebmotors();
                car = repo.Consultar(id);

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