Created
September 24, 2019 10:17
-
-
Save ntakouris/01140b73423c223db68e74913650c85f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<List<Post>> GetPostsAsync(string userId = null, PaginationFilter paginationFilter = null) | |
{ | |
var queryable = _dataContext.Posts.AsQueryable(); | |
if (paginationFilter == null) | |
{ | |
return await queryable.Include(x => x.Tags).ToListAsync(); | |
} | |
if (!string.IsNullOrEmpty(userId)) | |
{ | |
queryable = queryable.Where(x => x.UserId == userId); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment