Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created Jun 16, 2022
Embed
What would you like to do?
from user in _dbContext.Set<User>().AsNoTracking()
where user.Id == userId
let name = $"{user.FirstName} {user.LastName}"
let hasFirstName = !string.IsNullOrEmpty(user.FirstName)
let hasLastName = !string.IsNullOrEmpty(user.LastName)
select new
{
user.Id,
Name = name,
ProfileComplete = hasFirstName && hasLastName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment