Esempio n. 1
0
 public ActionResult <String> deleteHouse(string houseId)
 {
     try
     {
         _hs.deleteHouse(houseId);
         return(Ok("House Posting Successfully Delorted"));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Esempio n. 2
0
        public async Task <IActionResult> deleteHouse(string id)
        {
            var tem = await _housesService.deleteHouse(id);

            if (tem.DeletedCount != 1)
            {
                return(StatusCode(StatusCodes.Status400BadRequest, new { success = false, error = "delete error" }));
            }
            else
            {
                return(StatusCode(StatusCodes.Status200OK));
            }
        }