public void CreateWagon() { EmptyLists(); wagonRepository = new WagonRepository(context); Wagon wagon = new Wagon(4, "naam", 23, 45); Assert.Equal(4, wagonRepository.CreateWagon(wagon)); }
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()); }