【发布时间】:2013-05-26 10:47:03
【问题描述】:
我正在使用热毛巾模板并通过微风扩展了它的功能。我已经使用了breath.partial-entities.js 文件将微风实体转换为适当的dto,可以被淘汰的observables使用,如下所示。
function dtoToEntityMapper(dto) {
var keyValue = dto[keyName];
var entity = manager.getEntityByKey(entityName, keyValue);
if (!entity) {
// We don't have it, so create it as a partial
extendWith = $.extend({ }, extendWith || defaultExtension);
extendWith[keyName] = keyValue;
entity = manager.createEntity(entityName, extendWith);
}
mapToEntity(entity, dto);
entity.entityAspect.setUnchanged();
return entity;
}
对于少数实体,它可以正常工作并将微风数据转换为实体,但对于其中一个实体实现失败。相同的模型如下所示。
public class StandardResourceProperty
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
public int StandardResourceId{ get; set; }
public int InputTypeId{ get; set; }
public int ListGroupId{ get; set; }
public string Format{ get; set; }
public string Calculation{ get; set; }
public bool Required{ get; set; }
public int MinSize{ get; set; }
public int MaxSize{ get; set; }
public string DefaultValue{ get; set; }
public string Comment { get; set; }
public virtual StandardResource AssociatedStandardResource { get; set; }
public virtual List AssociatedList { get; set; }
}
我得到的错误是 TypeError: this[propertyName] 不是函数 [打破这个错误]
此属性名称;
breeze.debug.js(第 13157 行)
]
有代码
proto.setProperty = function(propertyName, value) {
this[propertyName](value);
// allow set property chaining.
return this;
};
请告诉我。实现也可能出现什么问题,如果我能就如何调试和跟踪此类问题获得更多建议,那就太好了。
【问题讨论】:
标签: asp.net-mvc-4 breeze hottowel