public ActionResult Delete(int id)
        {
            var result = _venueService.Delete(id);

            saveResult = _unitOfWork.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public async Task <IActionResult> Delete([FromQuery] int id)
        {
            var resultStatus = await _venueService.Delete(id);

            if (resultStatus == VenueOperationStatus.DoesNotExists)
            {
                return(NotFound());
            }

            return(NoContent());
        }
        public ActionResult Delete(int id)
        {
            var existingItem = _service.GetById(id);

            if (existingItem == null)
            {
                return(NotFound());
            }

            _service.Delete(id);
            return(Ok());
        }
Beispiel #4
0
 public async Task Delete(int id)
 {
     try
     {
         await _venueService.Delete(id);
     }
     catch (VenueException exception)
     {
         var fault = new ServiceValidationFaultDetails {
             Message = "Delete venue error"
         };
         throw new FaultException <ServiceValidationFaultDetails>(fault, exception.Message);
     }
 }
Beispiel #5
0
        public async Task <IActionResult> DeleteVenue(int?id)
        {
            if (id != null)
            {
                var venue = venueService.GetVenueById(id);
                if (venue != null)
                {
                    await venueService.Delete(venue);

                    return(RedirectToAction("Venue/GetVenueList"));
                }
            }
            return(NotFound());
        }