Page 1 of 1

expand expand expand

Posted: Tue 05 May 2009 11:47
by estern
This linq statement in Silverlight 2

Dim query = From p In myContext.WORKAREA_EMPLOYEE.Expand("EMPLOYEE").Expand("EMPLOYEE/SITELINK").Expand("EMPLOYEE/SITELINK/TRADE") _
Select p

Almost works. The ("EMPLOYEE/SITELINK/TRADE") does not work. The Trade object is nothing.

First is this a Microsoft issue or a Devarts issue? If it's a Devarts issue is there a way to get from table1 to table4 (workarea_employee, employee, siltelink, trade)

Posted: Wed 06 May 2009 10:26
by AndreyR
Could you please send us (suport * devart * com, subject "Silverlight Expand()") a small test project illustrating the problem?

Source and sql scripts have been sent to [email protected]

Posted: Mon 11 May 2009 03:05
by estern
the problem can be demonstrated with 3 tables

CREATE TABLE ES.A2
( "OI" NUMBER(11,0) NOT NULL ENABLE,
CONSTRAINT "A2_PK" PRIMARY KEY ("OI"));

CREATE TABLE ES.C2
( "OI" NUMBER(11,0) NOT NULL ENABLE,
"C2_DATA" VARCHAR2(10),
CONSTRAINT "C2_PK" PRIMARY KEY ("OI"));

CREATE TABLE ES.B2
("OI" NUMBER(11,0) NOT NULL ENABLE,
"OI_A2" NUMBER(11,0),
"OI_C2" NUMBER(11,0),
CONSTRAINT "B2_PK" PRIMARY KEY ("OI"),
CONSTRAINT FK_A2 FOREIGN KEY (OI_A2)
REFERENCES ES.A2 (OI),
CONSTRAINT FK_C2 FOREIGN KEY (OI_C2)
REFERENCES ES.C2 (OI));

The model looks correct

a2 is connected to b2 which is connect to c2

I can write, compile and execute this LINQ statement

Dim qA2B2C2 As Linq.IOrderedQueryable(Of A2)

qA2B2C2 = From A2B2C2 In m_ADOEntities.A2.Expand("B2").Expand("B2/C2") _
Where A2B2C2.OI = 1 Select A2B2C2



But get errors when trying to access data in C2