public IActionResult Create(int?id) { Service service = new Service(); if (id != null) { service.VehicleId = (int)id; } ViewData["VehicleId"] = new SelectList(_context.GetAllVehicles(), "Id", "Name"); return(View(service)); }
public IActionResult Create() { ViewData["VehicleId"] = new SelectList(_context.GetAllVehicles(), "Id", "Name"); return(View()); }