public FeedDTO GetFeed(string title, string publishDate) { var feed = feedCacheManager.Get(title); if (feed == null) { feed = feedRepository.GetFeed(title, publishDate); feedCacheManager.Set(title, feed); } return(Mapper.Map <FeedDTO>(feed)); }
public HttpResponseMessage Get(int id) { var f = feedRepository.GetFeed(id); if (f == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, string.Format("Feed with id {0} not found", id))); } return(Request.CreateResponse(f.Body)); }
public async Task <List <PublicationViewModel> > GetFeed(Guid userId, int amount, Guid?positionId, Guid?requestUserId) { if (amount <= 0) { throw new ArgumentOutOfRangeException(nameof(amount), "Amount must be greater than 0"); } if (amount > MaxPublicationAmount) { throw new ArgumentOutOfRangeException(nameof(amount), $"Amount cannot be greater than {MaxPublicationAmount}"); } if (!await UserService.Exists(userId)) { throw new UserNotFoundException("User not found"); } if (positionId.HasValue && !await PublicationService.Exists(positionId.Value)) { throw new DataNotFoundException($"{positionId.Value.ToString()} does not exists."); } return((await FeedRepository.GetFeed(userId, amount, positionId, requestUserId)).ToList()); }
public Feed GetFeed(System.Int32 FeedId) { return(_iFeedRepository.GetFeed(FeedId)); }
public List <FeedEvent> GetFeed(User user) { return(_feedRepository.GetFeed(user.UserID, MaxFeedCount)); }
public async Task <List <FeedEvent> > GetFeed(User user) { return(await _feedRepository.GetFeed(user.UserID, MaxFeedCount)); }