public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } ServisStavka = servisStavkaRepository.FindById((int)id); if (ServisStavka == null) { return(NotFound()); } return(Page()); }
public IActionResult OnPost() { if (!ModelState.IsValid) { return(Page()); } Servis.ServisStavka = servisStavka.FindById(ServisStavka); Servis.Vozilo = voziloRepo.FindById(Vozilo); try { servrepo.Update(Servis); } catch (DbUpdateConcurrencyException) { if (!ServisExists(Servis.IDServis)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public IActionResult OnPost() { Servis.Vozilo = voziloRepo.FindById(Vozilo); Servis.ServisStavka = servisStavka.FindById(ServisStavka); if (!ModelState.IsValid) { return(Page()); } servrepo.Create(Servis); return(RedirectToPage("./Index")); }