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

            wagonRepository = new WagonRepository(context);
            Wagon wagon = new Wagon(4, "naam", 23, 45);

            Assert.Equal(4, wagonRepository.CreateWagon(wagon));
        }
示例#2
0
 public IActionResult Create(WagonDetailViewModel vm)
 {
     if (ModelState.IsValid)
     {
         WagonViewModelConverter wagonViewModelConverter = new WagonViewModelConverter();
         Wagon   w  = wagonViewModelConverter.ViewModelToWagon(vm);
         decimal id = repo.CreateWagon(w);
         return(RedirectToAction("Details", new { id }));
     }
     return(View());
 }