Created
December 30, 2019 13:01
-
-
Save juancri/d76afb31ea6ef320131084384a5e3ec2 to your computer and use it in GitHub Desktop.
This file contains 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 User GetUserByToken(string tokenBody) | |
{ | |
var token = _context.Tokens.SingleOrDefault(t => t.Body == tokenBody); | |
if (token == null) | |
return null; | |
var user = _context.Users.SingleOrDefault(u => u.Id == token.UserId); | |
return user; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment