Table1 reference to Table2.
Table2 reference to Table3.
I want to load Table2 with loaded references to Table3.
My linq:
Code: Select all
using (var context2 = new MyDataContext())
{
var options = new DataLoadOptions();
options.LoadWith(o => o.Table3);
context2.LoadOptions = options;
context2.DeferredLoadingEnabled = false;
var values = from tab1 in context2.Tables1
where tab1.IdParent == 1
select tab1.Table2;
}
If I rewrite code to this:
Code: Select all
using (var context2 = new MyDataContext())
{
var options = new DataLoadOptions();
options.LoadWith(o => o.Table3);
context2.LoadOptions = options;
context2.DeferredLoadingEnabled = false;
var values = from tab1 in context2.Tables1
where tab1.IdParent == 1
select new
{
IdTable2 = tab1.Table2.Id,
IdTable3 = tab1.Table2.Table3.Id,
Table3Name = tab1.Table2.Table3.Name
};
}
And more. Why LoadWith() attached method always throw NotSupportedException with dotConnect for PostgreSQL? For example in this linq:
Code: Select all
using (var context2 = new MyDataContext())
{
var values = (from tab1 in context2.Tables1
where tab1.IdParent == 1
select tab1.Table2).LoadWith(o=>o.Table3);
}