public async Task <ActionResult <license_type> > Postlicense_type(license_type license_type) { _context.license_types.Add(license_type); await _context.SaveChangesAsync(); return(CreatedAtAction("Getlicense_type", new { id = license_type.id }, license_type)); }
public async Task <IActionResult> Putlicense_type(int id, license_type license_type) { if (id != license_type.id) { return(BadRequest()); } _context.Entry(license_type).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!license_typeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }