Skip to content

Instantly share code, notes, and snippets.

@itsdevcoffee
Last active July 22, 2016 20:53
Show Gist options
  • Save itsdevcoffee/a8bfa560f5c2bd2565a778a67018dcd1 to your computer and use it in GitHub Desktop.
Save itsdevcoffee/a8bfa560f5c2bd2565a778a67018dcd1 to your computer and use it in GitHub Desktop.
User()
.Include(u => u.UserPreferences)
.Select(u => new ProfileVm {
FirstName = u.FirstName,
LastName = u.LastName,
Email = u.Email,
Phone = u.PhoneNumber,
UserPreferences = new UserPreferencesVm
{
IsTall = u.UserPreferences?.IsTall,
IsSmall = u.UserPreferences?.IsSmall,
IsSomething = u.UserPreferences?.IsSomething,
} ?? null
})
.FirstOrDefaultAsync(u => u.Email == email);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment