Created
September 24, 2019 10:29
-
-
Save ntakouris/a6ab4bfcd3897f10151d2a6a2a18d2c1 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
private static IQueryable<Post> AddFiltersOnQuery(GetAllPostsFilter filter, IQueryable<Post> queryable) | |
{ | |
if (!string.IsNullOrEmpty(filter?.UserId)) | |
{ | |
queryable = queryable.Where(x => x.UserId == filter.UserId); | |
} | |
// Add other filtering logic here | |
return queryable; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment