I've had some success managing to connect breeze to our custom types on the server by creating a custom metadata definition and adding it to the breeze entity manager.
However, I'm unable to request an object (Employee) that has been custom-defined in javascript and retrieve its relationship(s) completely.
In other words, I have an object called Employee that has a property called "LoginStats" that is a List type on the server. When requesting this object using Breeze only one element returns in the collection, when there should be 6.
The results of the $promise look like this:
data.results[0].loginStats()[0] //object
data.results[0].loginStats()[1] //undefined
Strangely, if I individually select the properties, such as .select("LoginStats") it comes back complete with the 6 items in an array.
How is it possible for me to retrieve this object without spelling out all of the desired properties using a breeze call? I've attempted to use the .expand() clause, but unfortunately we are not connected to EntityFramework in a way that makes this work.
Thanks in advance!
EDIT: Here's a sample of what it looks like when I use the "select" statement vs just requesting the object. These images also demonstrate what happens when I select all of the properties, which is that they are all filled in correctly, but they are no longer observables. Eeeek!
Controller code:
[HttpGet]
public IQueryable<Employee> Get(string id)
{
var criterion = new Criterion<Employee, bool>(e => e.CustomerId == id);
var loginStatisticsExtendedProperty = new FillEmployeeLoginStatistics(_UserRoleProvider, _CustomerLoginStatsViewModelRepository);
var availableCompaniesForEmployess = new AvailableCompaniesForEmployess(_CompanyAffiliatesRepository);
return _EmployeeRepository.Find(criterion, loginStatisticsExtendedProperty, _EmployeeDetailsExtendedProperty, availableCompaniesForEmployess);
}