0

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: 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.

Ivan Sokalskiy
  • 812
  • 7
  • 14

1 Answers1

1

Could you try this with breeze 1.4.11 just to make sure that we haven't already fixed this?

If it still doesn't work, I'll register a test case and bug for this. Not sure if we'll get this fixed in the next release because we are already in testing for it. But it should be in the following one.

Jay Traband
  • 17,053
  • 1
  • 23
  • 44
  • Thank you for the fast reply! I just updated Breeze to 1.4.11 version and re-run the test (I have used Nuget, so it supposed to update not only client side, but also server side to be confident that I don't have mess there). Unfortunately, I can confirm that issue is still here. – Ivan Sokalskiy Apr 15 '14 at 22:44
  • 2
    @JayTraband I think I experience this too. Is there a ticket logged somewhere that I can follow? – Francois Botha May 15 '14 at 01:24