我有具有导航属性的实体,例如“父”(EntityType 的对象)和“子”(EntityType 的对象数组),但是当我将这些实体导出到另一个管理器时,导航属性“父”和“子”是为空或为空。
我使用下一行:
var query = entityQuery.from('Projects');
var entitiesTmp = manager.executeQueryLocally(query); //entitiesTmp have navigation properties
var exportData = manager.exportEntities(entitiesTmp);
var mgrTmp = new breeze.EntityManager(config.remoteServiceName);
mgrTmp.importEntities(exportData);
var entitiesTmp1 = mgrTmp.executeQueryLocally(query); //entitiesTmp1 doesn't have navigation properties
我有一个具有双向关联的分层类:
public abstract class HClass
{
public HClass()
{
Children = new List<HClass>();
}
[Key]
public int Id { get; set; }
public Nullable<int> ParentId { get; set; }
public string Name { get; set; }
public virtual ICollection<HClass> Children { get; set; }
public virtual HClass Parent { get; set; }
}
我有其他继承类:
public class AClass : HClass
{
public string Observation { get; set; }
}
public class BClass : HClass
{
public int Number { get; set; }
}
服务器中的 DbContext:
public DbSet<AClass> Projects { get; set; }
public DbSet<BClass> OtherProjects { get; set; }
请帮我解决这个错误。
注意:我使用的是微风 1.3.4