Esempio n. 1
0
 public async Task DeleteListing(DeleteListingRequest deleteListingRequest, string userId)
 {
     try
     {
         await _listingRepository.DeleteListing(deleteListingRequest.UserListingId,
                                                deleteListingRequest.OwnerId);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
        public HttpResponseMessage Delete(int listingId)
        {
            HttpResponseMessage response;

            try
            {
                listingRespository.DeleteListing(listingId);
                listingRespository.Save();
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, "Error");
                return(response);
            }
            response = Request.CreateResponse(HttpStatusCode.OK, "Success");
            return(response);
        }
Esempio n. 3
0
 public void DeleteListing(int listingId)
 {
     listingRepository.DeleteListing(listingId);
     unitOfWork.Save();
 }
Esempio n. 4
0
 public IActionResult Delete(Listing listing)
 {
     repository.DeleteListing(listing.Id);
     return(RedirectToAction("Index"));
 }
Esempio n. 5
0
        public async Task <bool> DeleteListing(int id)
        {
            int returnValue = await _listingRepository.DeleteListing(id);

            return(true);
        }
Esempio n. 6
0
 public async Task <int> DeleteListing(int id)
 {
     return(await _listingRepository.DeleteListing(id));
 }
Esempio n. 7
0
        public IActionResult DeleteListing(Listing listing)
        {
            listingRepository.DeleteListing(listing);

            return(RedirectToAction("Listings"));
        }
Esempio n. 8
0
 public void DeleteListing(int id)
 {
     _listingRepository.DeleteListing(id);
     _elastic.DeleteAsync <ElasticListing>(id);
 }