I am using Breeze 1.4.8 and trying to have a list of key/values pairs as Navigation properties with "nodb" conception.
I have 2 simple models:
function configureKeyValuePairDtoType(metadataStore) {
var prop;
var et = new entityType({
shortName: "KeyValuePairDto",
namespace: "DomainClasses.Dtos.Site",
autoGeneratedKeyType: AutoGeneratedKeyType.None
});
et.addProperty(prop = new DataProperty({
name: "key",
dataType: dataType.String,
isNullable: false,
isPartOfKey: true
}));
et.addProperty(prop = new DataProperty({
name: "value",
dataType: dataType.String,
isNullable: false
}));
metadataStore.addEntityType(et);
metadataStore.registerEntityTypeCtor("KeyValuePairDto", null, KeyValuePairDtoInitializer);
function KeyValuePairDtoInitializer(pair) {
}
}
function configureKeyValueStorageDtoType(metadataStore) {
var prop;
var et = new entityType({
shortName: "KeyValueStorageDto",
namespace: "DomainClasses.Dtos.Site",
autoGeneratedKeyType: AutoGeneratedKeyType.None
});
et.addProperty(new DataProperty({
name: "id",
dataType: dataType.Guid,
isNullable: false,
isPartOfKey: true
}));
et.addProperty(prop = new NavigationProperty({
name: "pair",
entityTypeName: "KeyValuePairDto",
isScalar: true
}));
et.addProperty(prop = new NavigationProperty({
name: "pairList",
entityTypeName: "KeyValuePairDto",
associationName: "KeyValueStorageDto_PairList",
isScalar: false
}));
metadataStore.addEntityType(et);
metadataStore.registerEntityTypeCtor("KeyValueStorageDto", null, KeyValueStorageDtoInitializer);
function KeyValueStorageDtoInitializer() {
}
}
Here is response from the server:
In the Breeze model I am getting as result, property pair has correct value, but pairList is just empty.
Please, advice, because it looks like an issue with my models' configuration, but for some reason I cannot find what's wrong.