public ActionResult OnGetDelete(int?id) { if (id != null) { Bll.ShippingMethod shippingMethod = new Bll.ShippingMethod(); shippingMethod.Id = (int)id; DbContext.Remove(shippingMethod); DbContext.SaveChanges(); return(RedirectToPage("Index")); } return(Page()); }
public ActionResult OnPostUpdate(Bll.ShippingMethod shippingMethod) { if (!ModelState.IsValid) { // als er een foutief gegeven is ingetypt ga terug // de pagina en toon de fout return Page(); // return page } // dbContext.OrderStatus.Update(orderStatus); dbContext.ShippingMethod.Update(ShippingMethod); dbContext.SaveChanges(); // keer terug naar de index pagina van OrderStatus return RedirectToPage("Index"); }