public IActionResult Write(int LabourerID, string FirstName, string LastName, int Gender, string Address, string ZipCode, string PhoneNumber, string Email) { //Insert een Labourer in de database Labourer lab = new Labourer(LabourerID, FirstName, LastName, Gender, Address, ZipCode, PhoneNumber, Email); MollShopContext context = HttpContext.RequestServices.GetService(typeof(TestWebApp.Models.MollShopContext)) as MollShopContext; context.WriteLabourer(lab); return(RedirectToAction("Index", "Labourer")); }