1

i am moving a Code first EF project to a DB first project, cause we need to add our project to an existing DB and use some of the existing tables.

when i run the CodeFirst project it returns the correct JSON:

correctJson

, but when i do the same on the DB first project it only returns the first object, and returns $refs for all the other objects.

badJson

1 Answer 1

2

You will need to make use of DTO's to transfer your data from your web api to the client application.

Those references are proxies for entity framework, to lazyload these but they don't get serialized in json.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.