1
当ResourceUnavailabilities
调用addEntityType,我得到的错误:error configuring an instance of 'NavigationProperty'. The 'entityTypeName' parameter must be a 'string'
微风:客户端模型与navigationProperty是给错误
我不明白这一点。我在微风的网站上看过tutorial,我不知道我做错了什么。
客户端模型:
metadataStore.addEntityType({
shortName: 'Unavailability',
namespace: 'ecdt',
dataProperties: {
id: { dataType: DT.Guid, isPartOfKey: true },
startDate: { dataType: DT.DateTimeOffset },
endDate: { dataType: DT.DateTimeOffset },
isDayOff: { dataType: DT.Boolean }
}
});
metadataStore.registerEntityTypeCtor('Unavailability', null, null);
metadataStore.addEntityType({
shortName: 'ResourceUnavailabilities',
namespace: 'ecdt',
dataProperties: {
id: { dataType: DT.Guid, isPartOfKey: true },
resourceId: { dataType: DT.Int32 },
},
navigationProperties: {
unavailabilities: { dataType: 'Unavailability', hasMany: true }
}
});
metadataStore.registerEntityTypeCtor('ResourceUnavailabilities', null, null);
除此之外寄托都工作正常。 (只要我删除了导航属性...)我可以创建Unavailability
实体,也ResourceUnavailabilities
实体
此外,在本教程中,您使用name
属性而不是shortname
。如果我这样做,我得到一个错误 Error configuring an instance of 'EntityType'. Unknown property: 'name'
。样本是否过时?
哪个文件?如果你给我一个链接,我会更新它。 – 2014-11-25 18:36:56
链接在我的第一篇文章(教程)中:这里又是:http://www.getbreezenow.com/documentation/metadata-by-hand – Sam 2014-11-26 07:42:05
什么部分是不正确的?该页面声明它使用“breeze.metadata-helper.js”组件来简化创建元数据。也许你没有看到,或者我错过了一些东西。 – 2014-11-27 22:32:58