public ActionResult Delete(string id) { var existingItem = _eventBL.GetById(id); if (existingItem == null) { return(NotFound()); } _eventBL.DeleteEvent(id); return(Ok()); }
public void DeleteEventTest() { Customer customer = new Customer(101, "Matt", "Knox"); Sale sale = new Sale(customer, DateTime.Today, productRepository.GetProductsState()); Supply supply = new Supply(DateTime.Today, productRepository.GetProductsState()); eventRepository.AddEvent(sale); eventRepository.AddEvent(supply); Event _event = eventRepository.GetAllEvents().First(); Assert.AreEqual(2, eventRepository.GetAllEvents().Count); eventRepository.DeleteEvent(_event); Assert.AreEqual(1, eventRepository.GetAllEvents().Count); }
public void DeleteEvent(Event @event) { eventRepository.DeleteEvent(@event); }
public int Delete(int id) { return(objevent.DeleteEvent(id)); }