私は Entity Framework 4.3.1 Code First を使用しており、次のようなものがあります。
class Program
{
static void Main(string[] args)
{
// get LogEntry with id x..
}
}
public class MyContext : DbContext
{
public DbSet<Log> Logs { get; set; }
}
public class Log
{
public int LogId { get; set; }
public ICollection<LogEntry> LogEntries { get; set; }
}
public class LogEntry
{
public int LogEntryId { get; set; }
}
整数の LogEntryId を指定して LogEntry オブジェクトを取得する最良の方法は何ですか? Log.LogEntries
プロパティを介さずにエンティティを直接取得することは可能ですか?