public async Task <bool> Edit(HouseForEditDto house) { var objectToEdit = _mapper.Map <House>(house); _db.Houses.Update(objectToEdit); await _db.SaveChangesAsync(); return(true); }
public async Task <IActionResult> Edit(HouseForEditDto house) { var result = await _houseService.Edit(house); if (result) { return(Ok("Edit successful")); } else { return(BadRequest("Failed to Edit")); } }