public IActionResult OnGet(int Id) { Vehiculo = service.GetVehiculosPorId(Id); if (Vehiculo == null) { return(RedirectToPage("VehiculoNoEncontrado")); } else { return(Page()); } }
public void OnGet(int?Id) { Marcas = helper.GetEnumSelectList <Marca>(); LugarFab = helper.GetEnumSelectList <LugarFab>(); TipoTransmision = helper.GetEnumSelectList <TipoTransmision>(); Color = helper.GetEnumSelectList <Color>(); if (Id.HasValue) { Vehiculo = service.GetVehiculosPorId(Id.Value); } else { Vehiculo = new Vehiculo(); } }
public void OnGet(int Id) { this.Vehiculo = service.GetVehiculosPorId(Id); }