public IActionResult GetEvent([FromRoute] Guid id) { try { var eventResult = _eventBLL.GetEventById(id); if (eventResult == null) { return(NotFound()); } return(Ok(eventResult)); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } }
public IHttpActionResult GetEventById(int eventId) { var Event = _bll.GetEventById(eventId); if (Event == null) { return(BadRequest()); } return(Ok(Event)); }
public void TestGetEventById() { var result = eventTest.GetEventById(5); Assert.AreEqual("TestEvent", result.Title); }