public ActionResult <IEnumerable <House> > Edit(string houseId, [FromBody] JsonElement edits)
 {
     try
     {
         return(Ok(_housesService.Edit(houseId, edits)));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Beispiel #2
0
 public ActionResult <House> Edit([FromBody] House editHouse, int id)
 {
     try
     {
         editHouse.Id = id;
         return(Ok(_service.Edit(editHouse)));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Beispiel #3
0
 public ActionResult <House> Edit(int id, [FromBody] House house)
 {
     try
     {
         house.Id = id;
         return(Ok(_service.Edit(house)));
     }
     catch (SystemException err)
     {
         return(BadRequest(err.Message));
     }
 }
 [HttpPut("{houseId}")] //EDIT
 public ActionResult <House> editHouse(string houseId, House editHouse)
 {
     try
     {
         editHouse.houseId = houseId;
         return(Ok(_service.Edit(editHouse)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
 public ActionResult <string> UpdateHouse([FromBody] House updated, string id)
 {
     try
     {
         updated.Id = id;
         House house = _ds.Edit(updated);
         return(Ok(house));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
 public ActionResult <House> Edit(int id, [FromBody] House houseToUpdate)
 {
     try
     {
         houseToUpdate.Id = id;
         string userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         return(Ok(_hs.Edit(houseToUpdate, userId)));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Beispiel #7
0
 public ActionResult <House> Edit([FromBody] House editedhouse, string houseId)
 {
     try
     {
         editedhouse.Id = houseId;
         House house = _ds.Edit(editedhouse);
         return(Ok(house));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Beispiel #8
0
 public ActionResult <House> Edit([FromBody] House updated, string id)
 {
     try
     {
         updated.Id = id;
         House updatedHouse = _hs.Edit(updated);
         return(Ok(updatedHouse));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Beispiel #9
0
 public ActionResult <House> Edit([FromBody] House editHouse, string id)
 {
     try
     {
         editHouse.Id = id;
         House house = _hs.Edit(editHouse);
         return(Ok(house));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }