public async Task <ActionResult <KundeType> > PostKundeType(KundeType kundeType) { _context.KundeType.Add(kundeType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetKundeType", new { id = kundeType.Id }, kundeType)); }
public async Task <IActionResult> PutKundeType(int id, KundeType kundeType) { if (id != kundeType.Id) { return(BadRequest()); } _context.Entry(kundeType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KundeTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public Kunde(Person person, int id, KundeType kundeType) : base(person.getFornavn(), person.getEtternavn(), person.getAdresse(), person.getTelefon(), person.getTelefon()) { this.id = id; this.kundeType = kundeType; }