XAF WinForms模块模型UI新增属性不显示,需重启VS才生效
XAF 24.1.6 WinForms EF 继承模型属性同步问题
我在XAF 24.1.6 WinForms + Entity Framework应用中使用Table-Per-Type继承,代码结构如下:
public class QuoteLineExt : JobExt {} public class JobExt : BaseJobExt {}
EF配置代码:
protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.HasChangeTrackingStrategy( ChangeTrackingStrategy.ChangingAndChangedNotificationsWithOriginalValues); modelBuilder.Entity<BaseJobExt>() .HasDiscriminator<byte>(x => x.HeadType) .HasValue<QuoteLineExt>((byte)1) // 其他子类配置 }
问题现象
向JobExt添加新属性后,执行清理、构建并更新模型:
- 该属性可在Module项目的
Model.DesignedDiffs.xafml模型编辑器UI的JobExt节点中正常显示; - 但在Module.Win项目的
Model.DesignedDiffs.xafml模型编辑器UI的JobExt节点中不显示,必须退出并重新打开Visual Studio后才会出现; - 一旦该属性在Module.Win模型编辑器的
JobExt→OwnMembers节点中显示,会自动同步出现在QuoteLineExt节点中。
内容的提问来源于stack exchange,提问作者Kirsten
相关产品推荐
相关产品推荐

