[HttpDelete("{id}")] //Delort
 public ActionResult <string> DeleteHouse(string id)
 {
     try
     {
         return(Ok(_service.Delete(id)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Beispiel #2
0
 public ActionResult <House> Delete(int id)
 {
     try
     {
         return(Ok(_service.Delete(id)));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
 public ActionResult <IEnumerable <House> > Delete(string houseId)
 {
     try
     {
         return(Ok(_housesService.Delete(houseId)));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
 public ActionResult <string> BuyHouse(string houseId)
 {
     try
     {
         _ds.Delete(houseId);
         return(Ok("Bought"));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
 public ActionResult <string> Delete(int id)
 {
     try
     {
         string userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         return(Ok(_hs.Delete(id, userId)));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Beispiel #6
0
 public ActionResult <String> Delete(string houseId)
 {
     try
     {
         _ds.Delete(houseId);
         return(Ok("Successfully Deleted"));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Beispiel #7
0
 public ActionResult <string> Delete(string id)
 {
     try
     {
         _hs.Delete(id);
         return(Ok("deleted"));
     }
     catch (Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
 public ActionResult <string> Delete(int id)
 {
     try
     {
         Claim user = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier);
         if (user == null)
         {
             throw new Exception("You must be logged in to make a House, yo.");
         }
         return(Ok(_service.Delete(user.Value, id)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
 public ActionResult <string> Delete(int id)
 {
     try
     {
         Claim user = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier);
         if (user == null)
         {
             throw new Exception("Login to do that!!");
         }
         string userId = user.Value;
         return(Ok(_hs.Delete(id, userId)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }