示例#1
0
        public void GetAllWagons()
        {
            EmptyLists();

            wagonRepository = new WagonRepository(context);

            Assert.Equal(3, wagonRepository.GetAllWagons().Count);
        }
示例#2
0
        public IActionResult Index()
        {
            List <Wagon>   wagons = repo.GetAllWagons();
            WagonViewModel vm     = new WagonViewModel
            {
                Wagons = new List <WagonDetailViewModel>()
            };

            foreach (Wagon wagon in wagons)
            {
                vm.Wagons.Add(converter.WagonToViewModel(wagon));
            }

            return(View(vm.Wagons));
        }