0
votes

Here is the quick setup:

  • desktop application (Windows forms application, running on XP, .NET 4.0) connected to WCF Data Service (using .NET 4.0, hosted on IIS 7.5)
  • 3 tables: T1, T2, T3 (SQL Server 2008)
  • T2 has FK that references T1
  • T2 has FK that references T3
  • in other words T2 breaks many-to-many between T1 and T3. In addition T2 has some additional columns (it is not pure "join" table).

We are trying to use the following expand:

...
from r in proxy.T1.Expand("T2/T3") where r.ID = 100
...

This expand returns different number of rows in T2 than expected.

If we do not include T3 like this:

...
from r in proxy.T1.Expand("T2") where r.ID = 100
...

we receive proper number of T2 rows back. Also, when we run SQL directly everything looks good.

1
If you post code, XML or data samples, please highlight those lines in the text editor and click on the "code samples" button ( { } ) on the editor toolbar to nicely format and syntax highlight it! - marc_s

1 Answers

1
votes

We got it. As soon as we removed

config.SetEntitySetPageSize("*", 20000)

from SVC file, everything worked. It appears that there is a BUG in this WCF Data Service method since whatever value we put there (small or huge) we have this issue. As soon as we removed a call to that method, everything worked perfectly.

Is there a hot fix or something like that for this that someone is aware of?

Thanks.