public async Task <IActionResult> PutMarriagetable(decimal id, Marriagetable marriagetable) { if (id != marriagetable.UId) { return(BadRequest()); } _context.Entry(marriagetable).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MarriagetableExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Marriagetable> > PostMarriagetable(Marriagetable marriagetable) { _context.Marriagetables.Add(marriagetable); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (MarriagetableExists((decimal)marriagetable.UId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetMarriagetable", new { id = marriagetable.UId }, marriagetable)); }