Exemplo n.º 1
0
        public void GetStationbyId()
        {
            EmptyLists();

            stationVerbindingRepository = new PerronRepository(context);
            Perron perron = new Perron(2, "naam", true);

            Assert.Equal(perron.Id, stationVerbindingRepository.GetPerronbyId(2).Id);
            Assert.Equal(perron.Naam, stationVerbindingRepository.GetPerronbyId(2).Naam);
            Assert.Equal(perron.Actief, stationVerbindingRepository.GetPerronbyId(2).Actief);
        }
Exemplo n.º 2
0
        public IActionResult Details(int id)
        {
            if (id < 1)
            {
                return(BadRequest("Id cannot be 0"));
            }

            Perron perron = repo.GetPerronbyId(id);

            if (perron == null)
            {
                return(BadRequest("Perron could not be found"));
            }

            PerronDetailViewModel vm = converter.PerronToViewModel(perron);

            return(View(vm));
        }