public async Task <ActionResult <MedallaTipo> > PostMedallaTipo(MedallaTipo medallaTipo) { _context.MedallaTipo.Add(medallaTipo); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMedallaTipo", new { id = medallaTipo.MedallaTipoId }, medallaTipo)); }
public async Task <IActionResult> PutMedallaTipo(int id, MedallaTipo medallaTipo) { if (id != medallaTipo.MedallaTipoId) { return(BadRequest()); } _context.Entry(medallaTipo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedallaTipoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }