public async Task <ActionResult <tenancyhousehold> > PostTenancyHousehold(tenancyhousehold tenancyhousehold) { _context.tenancyhousehold.Add(tenancyhousehold); await _context.SaveChangesAsync(); return(CreatedAtAction("Gettenancyhousehold", new { id = tenancyhousehold.tenancyHouseholdId }, tenancyhousehold)); }
public async Task <IActionResult> PutTenancyHousehold(int id, tenancyhousehold tenancyhousehold) { if (id != tenancyhousehold.tenancyHouseholdId) { return(BadRequest()); } _context.Entry(tenancyhousehold).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tenancyhouseholdExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }