When I use AsNoTracking () data from internal tables (table 2,3), it is lost during conversion in this row var result = myprojection.Select (g => g.table1) .FirstOrDefault ();
Selecting Table1, in an anonymous type, you will not have access to table2 or table3, although the navigation properties will not be displayed. Objects lose their relationship when you select an anonymous type, you need to select table two and three or not pull it into an anonymous type.
Just put your items directly in the table, where and then make your call
var myprojection = db.Table1.Join(db.Table2.Where(x => yourcondition), t1 => t1.id, t2 => t2.t1id, (t1, t2) => t1 );
then you need to make another join for table3
but it's probably best to make a call in two queries
source share