public Task <List <Post> > GetLatestPosts() { return(IncludedQueryable .Where(post => !post.IsPrivate) .OrderByDescending(post => post.Id).Take(3).ToListAsync()); }
public Task <List <Post> > GetFeaturedPosts() { return(IncludedQueryable .Where(post => post.Featured) .OrderByDescending(post => post.Id) .Take(3) .ToListAsync()); }
public Task <List <Post> > GetForCharacterIdAsync(long characterId) { return(IncludedQueryable.Where(post => post.IsPrivate == false && post.CharacterId.HasValue && post.CharacterId == characterId) .ToListAsync()); }
public Task <Post> GetPublicByIdAsync(long id, long userId) { return(IncludedQueryable .FirstOrDefaultAsync( post => post.Id == id && (post.IsPrivate == false || post.AuthorId == userId))); }
public Task <List <Post> > GetForUserIdAsync(long userId, bool getPrivate) { return(IncludedQueryable .Where(post => post.AuthorId == userId && getPrivate ? getPrivate : post.IsPrivate) .ToListAsync()); }
public Task <List <Post> > GetPostsByGameId(long gameId) { return(IncludedQueryable .Where(post => post.GameId == gameId && !post.IsPrivate) .ToListAsync()); }
public Task <List <Post> > GetPublicPostListAsync(long userId) { return(IncludedQueryable .Where(post => post.IsPrivate == false || post.AuthorId == userId) .ToListAsync()); }