public IActionResult Get() { try { List <Activity> activities = serviceActivity.GetAllActivities(); return(Ok(ToOutputModelList(activities))); } catch { return(BadRequest()); } }
/// <summary> /// Get list of Activity /// </summary> /// <returns>Activity message.</returns> public ActivityMessage GetAllActivities() { ActivityMessage message = new ActivityMessage(); try { message = _serviceActivity.GetAllActivities().ToMessage(); message.OperationSuccess = true; } catch (Exception e) { message.ErrorType = ErrorType.TechnicalError; message.ErrorMessage = e.Message; } return(message); }