Note that there are some explanatory texts on larger screens.

plurals
  1. PObreeze array , after push items, know in the server that array has changed
    primarykey
    data
    text
    <p>I have array of breeze in durandal project. in my client-side, after accept data from server, I push new items to the array. but when I come to server-side, it not show the array in the "originalValuesMap". it doesn't understanr that if I have add items to array- it mean that the array is now modified. what should I do?</p> <p>here is my code:</p> <p>in model.js, the definition of the classes is:</p> <pre><code> addPersonType(store); function addPersonType(store) { store.addEntityType({ shortName: "PersonDTO", namespace: "myServer.Entities", autoGeneratedKeyType: AutoGeneratedKeyType.Identity, dataProperties: { Emp_no1: { dataType: DataType.Int32, isNullable: false, isPartOfKey: true }, personAccessData: { name: "personAccessData", complexTypeName: "PersonAccessDTO:#myServer.Entities", isNullable: true } } }); store.registerEntityTypeCtor("EmployeeDTO", null, employeeInit); } addPersonAccessType(store); function addPersonAccessType(store) { store.addEntityType({ shortName: "PersonAccessDTO", namespace: "myServer.Entities", isComplexType: true, dataProperties: { PermGroup: { dataType: DataType.Int32, isNullable: true, isPartOfKey: false }, PermGroupName: { dataType: DataType.String, isPartOfKey: false }, MultyProfilesList: { isPartOfKey: false, isScalar: false } } }); store.registerEntityTypeCtor("PersonAccessDTO", null, null); } </code></pre> <p>my logic is:</p> <pre><code> for (var i = 0; i &lt; vm.multyProfilesSelectBox.destination().length; i++) { vm.data().MultyProfilesList().push(vm.multyProfilesSelectBox.destination()[i]); } </code></pre> <p>in the server:</p> <pre><code> List&lt;EntityInfo&gt; infos; string errorMessage = ""; if (!saveMap.TryGetValue(typeof(PersonDTO), out infos)) { return ""; } foreach (var ei in infos) { var personData = (PersonDTO)ei.Entity; if (personData .IsValid()) { if (ei.EntityState == EntityState.Added) { //some code... } else if (ei.EntityState == EntityState.Modified) { if (ei.OriginalValuesMap.ContainsKey("personAccessData")) { //some code... } } } else { throw new Exception("there validations errors in employee " + employeeData.GetErrorMessages()); } } </code></pre> <p>the problem is that the condition :</p> <pre><code> if (ei.OriginalValuesMap.ContainsKey("personAccessData")) </code></pre> <p>return false!!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload