I know I am doing something stupid here but I'm hoping someone with some Breezejs experience can help me out (please) as I am new to it. So the problem is when I do a breeze manager.saveChanges() the navigation properties (and only the navigation properties) are not sent to the server. In my model all the navigation properties are just lookup items if that makes any difference and I am using knockout to do the binding. Here is a screenshot to show whats wrong:-

the relevant bit in my dataservice just does this:-
function createAssessment() {
return manager.createEntity('VulnerabilityAssessment');
}
Domain model:-
public class VulnerabilityAssessment
{
public int Id { get; set; }
public virtual AssessmentStatus Status { get; set; }
public virtual PupilRecord Pupil { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public string LatestContact { get; set; }
public string Referrer { get; set; }
public virtual ReferralReason ReasonForReferral { get; set; }
public string SingleResponsibleAdult { get; set; }
public string CurrentIssues { get; set; }
public virtual ReferralSupport PrimaryReferralSupport { get; set; }
public virtual ReferralSupport SecondaryReferralSupport { get; set; }
public bool LikelyToLeaveWithoutQualification { get; set; }
public virtual Destination MovingOnDestination { get; set; }
public virtual Destination DestinationAfterOneMonth { get; set; }
public virtual Destination DestinationAfterSixMonths { get; set; }
public virtual Destination DestinationAfterTwelveMonths { get; set; }
public virtual ProtectedCharacteristic ProtectedCharacteristic { get; set; }
public string Undisclosed { get; set; }
}
Here is my viewmodel:-
define(['services/logger', 'services/dataservice'], function (logger, dataservice) {
var title = 'Vulnerability Assessment';
this.activate = function activate() {
var initialData = dataservice.getAssessmentLookups()
.then(function (data) {
vm.referralReasonCodes(data.referralReasonCodes);
vm.referralSupportCodes(data.referralSupportCodes);
vm.assessmentStatusCodes(data.assessmentStatusCodes);
vm.destinations(data.destinations);
vm.protectedCharacteristics(data.protectedCharacteristics);
vm.assessment(dataservice.createAssessment());
console.log('assessment: %A', vm.assessment());
})
.done();
logger.log(title, null, title, true);
return initialData;
}
this.save = function () {
console.log('in save: %A', vm.assessment());
dataservice.saveChanges();
}
var vm = {
activate: this.activate,
title: title,
referralReasonCodes: ko.observableArray(),
referralSupportCodes: ko.observableArray(),
assessmentStatusCodes: ko.observableArray(),
destinations: ko.observableArray(),
protectedCharacteristics: ko.observableArray(),
assessment: ko.observable(),
save: this.save
};
return vm;
});
View/HTML:-
<select id="reason-for-referral" class="form-control input-md" data-bind="options: $root.referralReasonCodes, optionsText: 'description', value: $data.reasonForReferral"></select>
Note: the select element above is within a another div that goes like this:-
<div class="row" data-bind="with: assessment">
Here is a look at my object just before it is sent to the server.

Totally stuck at the moment... Many thanks for taking a look.