Say we have a project with this entities:
class User
{
public Guid Id { get; set; }
public List<Message> Messages { get; set; }
...
}
class Message
{
public Guid Id { get; set; }
public string Message { get; set; }
}
Now consider a scenerio where i want to get all the messages that a certain user posted, how can one achieve this without pulling the user information aswell? (without using the context.Users.Include(...) ) ? I know that the entity framework creates a column in the Message table that holds the Id of the user that posted this message, but how can i have an access to this value? as it is not a property in my original class.