entity framework - EF4 Self-Tracking entities and WCF serialization creates stack overflow -


I try to work above the configuration, but no luck.

Step 1)

I started a new solution with the WCF Service Application project.

Step 2)

In this project, I've added an ADMX file and made a much easier model:
DisplayName with parent and ID and ChildDisplayName association with Em>
unit Child < Kids , 1-to-M , navigation on both organizations Properties are created in
After the generation I prepared the database without any problem, I manually inserted an parent object into two related hair objects in the database manually

Step 3)

I used the ADO.NET self-tracking unit generator Added code generation. I know that this should be done in different assemblies, but to make it straight and easy, I put it in the same project (WCF project)

step 4)

I have just changed the IService interface to get a simple

  [OperationCectract] Parent GETRUDUData (Int 32 ID);   

In this implementation, I take an page object from context and return it:

 using  ( PpjSteContainer _context = New PpjSteContainer ()) {Return _context.ParentSet.Include ("child"). Single (x => x.id == ID); }  Problem:   

If I now run this project (service is 1.svc start page), VS2010 automatically generates test client generating service But once I invoke the service, I get the stack overflow exception!

If I remove ("hair") everything is fine, but surely the children objects are no longer missing.
I do not know what I'm missing, I read so many more guides, but in every way I did it (at least it seems to me) ...
I try the example of school But this does not work for me because it does not match the database generation and coding in the example.

So, I would be very appreciated if someone can guide me how it works.

PS

  • Yes, all the unit squares have been marked "[Data Contracts (Irfariens = True)]"
  • Slight-loading is set to "false" in the ADMX file

    edit:
    I hosted WCF in the console app And now not in IIS. Of course, I had to write a little test client myself.
    It is strange, now everything is working. I definitely do not know why, but at least this is a solution for my test ...

    Take a look. Basically you must be aware of the serializer in the carrier properties to the chakras.

Comments