首页 > 解决方案 > XAF 查找属性在列表视图中正确显示,但在详细视图中为空

问题描述

我有以下商务课程(简化)

public class Customer {

  Customer()
  {
  }
  public int Id {get;set;}
  public string Name {get;set;}
  public virtual Category {get;set;}
}

Public Class Category {
  public int Id {get;set;}
  public string Name {get;set;}
}

如果我将它们粘贴到新的 XAF EF Winforms 演示项目中,它们可以正常工作。

但是在我的开发项目中,类别在列表视图中正确显示,但在详细视图中为空。

为什么?

[Nuget?] 开发项目正在使用Nuget安装XAF。我目前正在使演示项目使用 Nuget 来查看是否会导致问题。

我不这么认为,演示项目使用Nuget后仍然很好。

[数据库中是否存在 smallint?] 该字段存在于表中,但模型中不存在...正在调查。

[LazyLoading?] 这可以解释,但我看不到任何设置打开它

标签: entity-framework-6nugetxaf

解决方案


需要公共构造函数 https://www.devexpress.com/Support/Center/Question/Details/Q207865/unable-to-add-new-record-to-detail-view

public class Customer {

  public Customer()
  {
  }
  // etc
}

推荐阅读