public ActionResult <House> Update(int id, [FromBody] House updatedHouse) { try { Claim user = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier); if (user == null) { throw new Exception("You must be logged in to make a House, yo."); } updatedHouse.UserId = user.Value; updatedHouse.Id = id; return(Ok(_service.Update(updatedHouse))); } catch (System.Exception err) { return(BadRequest(err.Message)); } }