public async Task <IActionResult> Edit(int id, [Bind("Id,Naam,Rekeningnummer,Gemeente,Straat,Huisnummer,PostCode")] Producent producent)
        {
            if (id != producent.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    producentRepository.Update(producent);
                    await producentRepository.SaveAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProducentExists(producent.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(producent));
        }
Exemple #2
0
 public void EditProducent(Producent producent)
 {
     producentRepo.Update(producent);
 }