entity framework - Resolving associated objects in SL4 RIA -


itemprop = "text">

In VS2010, creating a standard Silverlight business application and establishing a model from a SQL Server database, I have various organizations and associations, Out of which Asset Group and Asset 1: m are in relationship.

Allegedly, I can use dot notation to extract assets from asset examples. Through modern miracles of suspended execution and lazy loading, I am assured that my data will be given to me a very moment.

But it does not work.

What are the prizes, and do I have to kill a chicken or a goat?

Looks promising as soon as I have tried to do it, I will update.

In the question I mention a blog post containing a possible solution This solution works, but There may be a change in the generated code, which is clearly weak as a solution.

Here's a strong way to implement solutions: Change the code generator.

  1. Right-click the context menu on the EDMX Designer surface and add code generation items ...
  2. on "Model1.tt" Try improving the name of a name to save the TT file.
  3. Open the TT file.
  4. "Change to" ("Search for directly changing method template, which you need to change."
  5. Edit as
  6. Reconstruction of the solution.

Change it

  returns / * large hair expression * /  < 

var unit = / * large hair expression * /; if (! Unit.isloaded) unit. Load (); return unit;

Comments