4
votes

I am using the most up-to-date (as of today) BreezeJS, AngularJS, .NET, Entity Framework, etc.

I have a Breeze application that looks to be set up correctly, however the results.data returned from executeQuery(query) contains empty objects (i.e. they evaluate to null).

I am using the BreezeJS take(1) filter and get one result to keep things simple.

I am able to pull up the metadata page (e.g. ~/breeze/appname/Metadata) and see the SQL Server database columns just fine.

So, what could be up? Anyone know what is breaking down from a conceptual standpoint?

Client-side query:

 var query = breeze.EntityQuery
        .from("Biography")
        .select("ENTITY_ID, NAME, NICKNAME")
        .orderBy("ENTITY_ID")
        .take(1);

Server-side [HttpGet]:

[HttpGet]
    public IQueryable<BIOGRAPHY> Biography()
    {
        var biography = _contextProvider.Context.BIOGRAPHY;
        return biography;
    }

Redacted JSON Response:

[{
  "$id":"1",
  "$type":"_IB_JNMBHFIpB3WQZ6daOssY9Dxx_p8Y[[System.String, mscorlib],[System.String, mscorlib],[System.String, mscorlib]], _IB_JNMBHFIpB3WQZ6daOssY9Dxx_p8Y_IdeaBlade",
  "ENTITY_ID":"4815162342",
  "NAME":"Mr. Hugo Reyes",
  "NICKNAME":null
}]
1
What does the client side query look like and what does the server side [HttpGet] method look like>Jay Traband
@JayTraband Thanks, I added client-side and server-side code to the question.user3071284
Are you sure you actually are returning anything? Also could you post the raw json you are getting back from your browsers network tab?PW Kad
@PWKad Surprisingly, the data for the record is in the JSON response just not in the data.results variable in Breeze. I changed the name in the record returned to protect the innocent and updated my question.user3071284
Glad you found it. Good luck with Breeze.PW Kad

1 Answers

0
votes

Case-sensitivity on the AngularJS output: instead of item.entity_id it has to be item.ENTITY_ID to match the case of the JSON response. Thanks guys for getting me thinking.