I ave table structure like this
description:
user has many user profiles, user_profile table join user and profile tables together.(there is a many to many relationship between user and the profile table)
user>one-to-many>user_profiles>one-to-one>profiles
user>many user_profiles> one profile
Problem:
How can i select user with profile by using linq.
sample:
var user=cbContext.user.include("user_profiles").include("profiles").Where(predicate).FirstOrDefault();
Found the answer
dbContext.Users
.Include(user => user.UserProfiles)
.ThenInclude(userProfiles => userProfiles.Profile)
.Where(predicate)
.FirstOrDefault();