Created
June 4, 2019 07:09
-
-
Save algorythm/8e7b1846c19aeef3c53b8019700eb74a 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
| // ... | |
| var userTask = _context.Users | |
| .ByUserId(userId) | |
| .FirstOrDefaultAsync(); | |
| var postTask = _context.SocialFeedPosts | |
| .ByPostId(postId) | |
| .FirstOrDefaultAsync(); | |
| await Task.WhenAll(userTask, postTask); | |
| if (userTask.Result == null || postTask.Result == null) | |
| { | |
| return null; | |
| } | |
| // ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment