public IHttpActionResult GetAllJoinList() { try { ItemsResponse <TimelineFeedResponse> response = new ItemsResponse <TimelineFeedResponse> { Items = _timelineFeedService.GetAllJoinList(_authenticationService.GetCurrentUserId()) }; return(Ok(response)); } catch (Exception ex) { _errorLogService.Post(new ErrorLogAddRequest { ErrorSourceTypeId = 1, Message = ex.Message, StackTrace = ex.StackTrace, Title = "Error in " + GetType().Name + " " + System.Reflection.MethodBase.GetCurrentMethod().Name }); return(BadRequest(ex.Message)); } }
public IHttpActionResult GetAll() { try { ItemsResponse <CommentVote> response = new ItemsResponse <CommentVote> { Items = _commentVoteService.GetAll() }; return(Ok(response)); } catch (Exception ex) { _errorLogService.Post(new Models.Requests.Logs.ErrorLogAddRequest { ErrorSourceTypeId = 1, Message = ex.Message, StackTrace = ex.StackTrace, Title = "Error in " + GetType().Name + " " + System.Reflection.MethodBase.GetCurrentMethod().Name }); return(BadRequest(ex.Message)); } }
public IHttpActionResult GetAll() { try { ItemsResponse <IssueLogCategoryType> response = new ItemsResponse <IssueLogCategoryType> { Items = _issueLogCategoryTypeService.GetAll() //puts result of this function into items }; return(Ok(response)); } catch (Exception ex) { _errorLogService.Post(new ErrorLogAddRequest { ErrorSourceTypeId = 1, Message = ex.Message, StackTrace = ex.StackTrace, Title = "Error in " + GetType().Name + " " + System.Reflection.MethodBase.GetCurrentMethod().Name }); return(BadRequest(ex.Message)); } }
public IHttpActionResult GetById(int id) { try { int userBaseId = _authenticationService.GetCurrentUserId(); ItemResponse <EventDetailsPage> response = new ItemResponse <EventDetailsPage> { Item = _eventDetailsPageService.GetById(id, userBaseId) }; return(Ok(response)); } catch (Exception ex) { _errorLogService.Post(new Models.Requests.Logs.ErrorLogAddRequest { ErrorSourceTypeId = 1, Message = ex.Message, StackTrace = ex.StackTrace, Title = "Error in " + GetType().Name + " " + System.Reflection.MethodBase.GetCurrentMethod().Name }); return(BadRequest(ex.Message)); } }
public IHttpActionResult GetEventsByFollowerId() { try { int UserBaseId = _authenticationService.GetCurrentUserId();//dependency injection - event class uses authentication service class ItemsResponse <EventListing> response = new ItemsResponse <EventListing> { Items = _eventListingService.GetEventsByFollowerId(UserBaseId) }; return(Ok(response)); } catch (Exception ex) { _errorLogService.Post(new Models.Requests.Logs.ErrorLogAddRequest { ErrorSourceTypeId = 1, Message = ex.Message, StackTrace = ex.StackTrace, Title = "Error in " + GetType().Name + " " + System.Reflection.MethodBase.GetCurrentMethod().Name }); return(BadRequest(ex.Message)); } }
public IHttpActionResult GetAll() { try { ItemsResponse <UserBase> response = new ItemsResponse <UserBase> { Items = _userBaseService.GetAll() // put the result of this function into items }; return(Ok(response)); } catch (Exception ex) { _errorLogService.Post(new Models.Requests.Logs.ErrorLogAddRequest { ErrorSourceTypeId = 1, Message = ex.Message, StackTrace = ex.StackTrace, Title = "Error in " + GetType().Name + " " + System.Reflection.MethodBase.GetCurrentMethod().Name }); return(BadRequest(ex.Message)); //show us the exception msg } }