public async Task <IActionResult> Putcard_type_prefixes([FromRoute] int id, [FromBody] card_type_prefixes card_type_prefixes) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != card_type_prefixes.id) { return(BadRequest()); } _context.Entry(card_type_prefixes).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!card_type_prefixesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Postcard_type_prefixes([FromBody] card_type_prefixes card_type_prefixes) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.card_type_prefixes.Add(card_type_prefixes); await _context.SaveChangesAsync(); return(CreatedAtAction("Getcard_type_prefixes", new { id = card_type_prefixes.id }, card_type_prefixes)); }