非标量导航属性未填充“ nodb”。概念 [英] Non scalar navigation properties are not populating with "nodb" conception

查看:120
本文介绍了非标量导航属性未填充“ nodb”。概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Breeze 1.4.8,并尝试使用 nodb概念将键/值对的列表作为导航属性。

I am using Breeze 1.4.8 and trying to have a list of key/values pairs as Navigation properties with "nodb" conception.

我有2个简单模型:

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:

在Breeze模型中,结果是,属性 pair 具有正确的值,但 pairList 仅是空的。

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.

推荐答案

是否可以在微风1.4.11上尝试此操作,以确保我们尚未解决此问题?

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.

这篇关于非标量导航属性未填充“ nodb”。概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆