I am trying to enhance the following Angular/MVC 4 example: https://github.com/danielcsgomes/AngularJS-NetPonto
The code I am using is identical, save (1) Changing the Process class name to "Product", and, (2) Adding a "Vendor" class, as an associated class to Product, (and Vendor having a collection of products).
Everything is fine in the API.
However, if I pass the Product class with its associated Vendor, those Products that have the same Vendor will not appear in the list. But, if I make the API return an anonymous type and pass a variable called VendorName, duplicates will appear. Naturally, I would like NOT to use anonymous types so is there a solution to this?
Exhibit A: Straight forward context.Products.Include("Vendors"):
Exihbit B: As an anonymous type return:
Below are (1) My angular controller to get all products, (2 & 3) The templates to display the data
Template without anonymous type return:
Template with anonymous type return:
So my question is this:
How can I make angular accept duplicate Vendor names for the respective products w/o being required to return the data as an anonymous type?