Example #1
0
        public IHttpActionResult Delete(int id)
        {
            var Ad = adRepo.Get(id);

            adRepo.Delete(id);
            specificationRepo.Delete(Ad.SpecId);
            addressRepo.Delete(Ad.AddressId);
            return(StatusCode(HttpStatusCode.NoContent));
        }
        [Route("api/requestAd/{id}")]  //deleting ad
        public IHttpActionResult Delete(int id)
        {
            var adr = adRepo.Get(id);

            adRepo.Delete(id);
            specRepo.Delete(adr.SpecId);
            addressRepo.Delete(adr.AddressId);
            return(StatusCode(HttpStatusCode.NoContent));
        }
 public ActionResult Delete([FromServices] SpecificationRepository dao, string toDelete)
 {
     try
     {
         dao.Delete(toDelete);
         return(new StatusCodeResult(200));
     }
     catch (Exception e)
     {
         return(new BadRequestResult()
         {
         });
     }
 }