public ActionResult <CalendarEventAddViewModel> DeleteCalendarEvent(CalendarEventAddViewModel calendarEvent) { CalendarEventAddViewModel deleteCalendarEvent = new CalendarEventAddViewModel(); try { deleteCalendarEvent = _calendarEventService.DeleteCalendarEvent(calendarEvent); } catch (Exception es) { deleteCalendarEvent._failure = true; deleteCalendarEvent._message = es.Message; } return(deleteCalendarEvent); }
/// <summary> /// Delete CalendarEvent by id /// </summary> /// <param name="id">CalendarEvent id</param> /// <returns>true if the CalendarEvent is deleted successfully</returns> public IHttpActionResult Delete(int id) { try { // delete log.Debug("_calendarEventService.DeleteCalendarEvent - calendarEventId: " + id + " "); _calendarEventService.DeleteCalendarEvent(id); log.Debug("result: 'success'"); //return JsonConvert.SerializeObject(true); return(Ok(true)); } catch (Exception e) { // error log.Error(e.ToString()); throw; } }
public IActionResult Delete(int id) { _service.DeleteCalendarEvent(id); return(Ok()); }