I'm creating an Asp.Net Web.API application and the service return is in Json.
So far so good, it turns out that the main object (Companies) is returning an internal object - citiesFiliais (Branches by City) with a Bracket that is not interpreted correctly by View.
In the View I already did a test including the object manually in the page without the inclusion of "[]" and in this way when invoking {{company.cidesfiliais.city}} > the name of each City is displayed without any problem. But by invoking the Json directly from the BackEnd the records for the citiesFiliais object are not displayed on the screen.
I know the only problem is the internal "[]" as mentioned before, the question is, how do I make the return of the BackEnd equal to the 2nd example shown below?
1st Example - Current JSON form:
{ "company": "Industry Reunidas", "PrimaryPhone": "3030-9999", "citiesFiliais": [ { "city": "Belo Horizonte", "status": "MG", "ddd": 31 }, { "city": "Savior", "status": "BA", "ddd": 71 }, { "Sao Paulo city", "status": "SP", "ddd": 11 } ] }
Example 2 - How JSON should be generated:
{ "company": "Industry Reunidas", "PrimaryPhone": "3030-9999", "citiesFiliais": { "city": "Belo Horizonte", "status": "MG", "ddd": 31 }, { "city": "Savior", "status": "BA", "ddd": 71 }, { "Sao Paulo city", "status": "SP", "ddd": 11 } }
Thanks for the force !!!